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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

.navbar {
    background: #1a1a2e;
    color: #fff;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    color: #ccc;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: background 0.15s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

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

h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

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

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a1a2e;
    box-shadow: 0 0 0 2px rgba(26,26,46,0.15);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-primary {
    background: #1a1a2e;
    color: #fff;
}

.btn-primary:hover {
    background: #16213e;
}

.btn-success {
    background: #2d6a4f;
    color: #fff;
}

.btn-success:hover {
    background: #1b4332;
}

.btn-warning {
    background: #e76f51;
    color: #fff;
}

.btn-warning:hover {
    background: #c44536;
}

.btn-danger {
    background: #c1121f;
    color: #fff;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.btn-danger:hover {
    background: #a4161a;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #666;
    background: #fafafa;
}

tr:hover {
    background: #f9f9f9;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1rem 1.25rem;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
}

/* Result list */
.result-list {
    list-style: none;
    padding: 0;
}

.result-list li {
    padding: 0.35rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
}

.result-list li:last-child {
    border-bottom: none;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-used {
    background: #ffeaa7;
    color: #856404;
}

.badge-normal {
    background: #dfe6e9;
    color: #2d3436;
}

/* Navbar user */
.nav-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-username {
    color: #aaa;
    font-size: 0.85rem;
}

/* Login page */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 60px);
}

.login-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.85rem;
}

.login-footer a {
    color: #1a1a2e;
}
