/* ===== Base ===== */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    background: #f4f5f7;
    color: #222;
    font-size: 16px; /* base */
}

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

/* ===== Header ===== */
.site-header {
    background: #1f2933;
    color: #fff;
    padding: 0.75rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 600;
}

.main-nav a {
    color: #e5e7eb;
    margin-left: 1rem;
    text-decoration: none;
}

.main-nav a:hover {
    text-decoration: underline;
}

.header-user {
    margin-left: 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ===== Layout ===== */
.main-content {
    padding: 1.5rem 0 3rem;
}

.card {
    background: #fff;
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.card h1,
.card h2,
.card h3 {
    margin-top: 0;
}

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

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.45rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #cbd2e1;
    box-sizing: border-box;
}

/* ===== Buttons (unified) ===== */
button,
.button,
.btn {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border-radius: 6px;
    border: none;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.1;
    white-space: nowrap;
}

button:hover,
.button:hover,
.btn:hover {
    background: #1d4ed8;
}

.button-danger {
    background: #dc2626;
}
.button-danger:hover {
    background: #b91c1c;
}

/* A smaller button variant if you need it in tables later */
.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

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

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

/* ===== Tables ===== */
/* Smaller font for tables – main request */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    table-layout: fixed;          /* prevent horizontal overflow */
    font-size: 0.9rem;            /* ↓ smaller */
    line-height: 1.25;            /* tighter rows */
}

.table th,
.table td {
    border: 1px solid #e5e7eb;
    padding: 0.45rem 0.5rem;      /* ↓ slightly tighter */
    text-align: left;
    vertical-align: top;
}

/* Make headers stand out but not huge */
.table th {
    font-weight: 600;
    background: #fafafa;
}

/* Keep long emails and names from blowing out layout */
.table td,
.table th {
    overflow-wrap: anywhere;      /* modern wrap */
    word-break: break-word;       /* fallback */
}

/* E-mail column commonly overflows: ensure wrap */
.table td:nth-child(2) {
    word-break: break-all;        /* aggressive wrap for emails if needed */
}

/* Action cell: keep buttons aligned and consistent */
.table td .button,
.table td .btn,
.table td button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    padding: 0 0.75rem;
    font-size: 0.85rem;
    margin-right: 0.4rem;
}

/* Avoid accidental horizontal scroll bars in cards with wide tables */
.card {
    overflow-x: auto;
}

/* ===== Footer ===== */
.site-footer {
    color: #6b7280;
    text-align: center;
    padding: 1rem 0 2rem;
    font-size: 0.9rem;
}
