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

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

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

/* Nav */
nav { background: #1e40af; color: #fff; padding: 0.75rem 1rem; display: flex; justify-content: space-between; align-items: center; }
nav a { color: #fff; text-decoration: none; margin-left: 1rem; }
nav a:hover { text-decoration: underline; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff; margin-top: 1rem; }
th, td { padding: 0.5rem 0.75rem; border: 1px solid #ddd; text-align: left; }
th { background: #f0f0f0; font-weight: 600; }
tr:hover { background: #f9f9f9; }

/* Sortable columns */
.sortable { cursor: pointer; user-select: none; transition: background-color 0.2s; }
.sortable:hover { background-color: #e5e5e5; }
.sort-icon { font-size: 0.8em; color: #999; margin-left: 4px; }
.sortable.asc .sort-icon, .sortable.desc .sort-icon { color: #1e40af; font-weight: bold; }

/* Forms */
label { display: block; margin-top: 0.75rem; font-weight: 500; }
input, select, textarea { width: 100%; padding: 0.5rem; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; margin-top: 0.25rem; }
input:focus, select:focus { outline: none; border-color: #1e40af; box-shadow: 0 0 0 2px rgba(30,64,175,0.15); }

/* Buttons */
.btn { display: inline-block; padding: 0.5rem 1.25rem; border: none; border-radius: 4px; font-size: 1rem; cursor: pointer; text-decoration: none; }
.btn-primary { background: #1e40af; color: #fff; }
.btn-primary:hover { background: #1e3a8a; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-secondary:hover { background: #4b5563; }

/* Flash messages */
.flash { padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}
.modal-box {
    background: white;
    max-width: 500px;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 8px;
}
.modal-box h2 { margin-bottom: 1rem; color: #dc2626; }
.modal-box p { margin-bottom: 1rem; }
.modal-box ul { margin: 1rem 0; padding-left: 2rem; }
.modal-box label { display: block; margin-bottom: 0.5rem; }
.modal-box .reset-error { display: none; color: #dc2626; margin-top: 0.5rem; font-weight: 600; }
.modal-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

/* Badges */
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.8rem; color: #fff; }
.badge-admin { background: #1e40af; }
.badge-operator { background: #16a34a; }

/* Utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
