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

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

/* Login Screen */
#login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 400px;
}
.login-box h1 { text-align: center; margin-bottom: 1.5rem; }
.login-box input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}
.login-box button {
    width: 100%;
    padding: 0.75rem;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}
.login-box button:hover { background: #34495e; }
#login-error { color: #e74c3c; text-align: center; margin-top: 0.5rem; }

/* Nav */
#navbar {
    background: #2c3e50;
    padding: 0.5rem 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
#navbar button {
    background: none;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 4px;
}
#navbar button:hover { background: rgba(255,255,255,0.1); }
#logout-btn { margin-left: auto; background: #e74c3c !important; }

/* Main Content */
#app { padding: 1rem; max-width: 1200px; margin: 0 auto; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}
th { background: #ecf0f1; font-weight: 600; }
tr:hover { background: #f8f9fa; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.form-group input, .form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn-primary { background: #2c3e50; color: white; }
.btn-danger { background: #e74c3c; color: white; }
.btn-success { background: #27ae60; color: white; }

/* Cards */
.card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

/* Alert */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}
.alert-error { background: #fde8e8; color: #c0392b; }
.alert-success { background: #e8fde8; color: #27ae60; }

/* Inline edit inputs in table cells */
tr.row-editing td { background: #fffde7; }
tr.row-editing .edit-input { width: 100%; padding: 0.3rem 0.5rem; border: 2px solid #f9a825; border-radius: 4px; font-size: 0.9rem; }

/* Responsive */
@media (max-width: 768px) {
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    td {
        padding: 0.5rem 0.75rem;
        text-align: right;
        position: relative;
    }
    td:before {
        position: absolute;
        left: 0.75rem;
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
    }
}
