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

html { font-size: 16px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: #1a1a1a;
    background-color: #f5f5f5;
    min-height: 100vh;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

/* ─── Header ──────────────────────────────────────────────────────────────── */

.page-header {
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
}

/* ─── Navigation ──────────────────────────────────────────────────────────── */

.nav-bar {
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    padding: 0.25rem 0;
}

.nav-link:hover { color: #2563eb; text-decoration: none; }
.nav-link.active { color: #2563eb; border-bottom: 2px solid #2563eb; }
.nav-spacer { margin-left: auto; }
.nav-logout { font-size: 0.875rem; font-weight: 500; color: #6b7280; text-decoration: none; }
.nav-logout:hover { color: #dc2626; text-decoration: none; }

/* ─── Content ─────────────────────────────────────────────────────────────── */

.page-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */

button, .btn {
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.875rem;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: background-color 0.15s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary { background-color: #2563eb; color: #fff; border-color: #2563eb; }
.btn-primary:hover { background-color: #1d4ed8; }
.btn-secondary { background-color: #fff; color: #374151; border-color: #d1d5db; }
.btn-secondary:hover { background-color: #f9fafb; }
.btn-danger { background-color: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background-color: #b91c1c; }
.btn-sm { font-size: 0.8rem; padding: 0.25rem 0.625rem; }

/* ─── Forms ───────────────────────────────────────────────────────────────── */

input[type="text"],
input[type="number"],
select,
textarea {
    font-family: inherit;
    font-size: 0.875rem;
    padding: 0.4rem 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    width: 100%;
    background-color: #fff;
    color: #1a1a1a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.2rem;
}

.form-group { margin-bottom: 0.875rem; }

/* ─── Tables ──────────────────────────────────────────────────────────────── */

.table-wrapper {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead { background-color: #f9fafb; }

th {
    text-align: left;
    padding: 0.625rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e7eb;
}

td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: #fafafa; }

.empty-state {
    text-align: center;
    color: #9ca3af;
    padding: 2rem 1rem;
}

/* ─── Tags ────────────────────────────────────────────────────────────────── */

.tag {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #e0e7ff;
    color: #3730a3;
    margin-right: 0.25rem;
}

/* ─── Toolbar ─────────────────────────────────────────────────────────────── */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* ─── Cards / Panels ──────────────────────────────────────────────────────── */

.card {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

/* ─── Utility ─────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }
.text-muted { color: #9ca3af; }
.row-actions { display: flex; gap: 0.5rem; align-items: center; }
.error-message { color: #dc2626; font-size: 0.85rem; margin-top: 0.5rem; }
