/*
 * MyCPDLog — application stylesheet
 * ---------------------------------------------------------------------------
 * A small component layer on top of Tailwind. Every rule here replaces a long
 * utility string that was repeated dozens of times across app/Views.
 *
 * Cascade: this file is linked BEFORE the Tailwind CDN script, so the runtime
 * injects its utilities after these rules. A utility in the markup therefore
 * still wins over a component — `class="card p-4"` overrides the card padding
 * exactly as it did when the card was spelled out in utilities.
 *
 * Values below are the literal Tailwind v3 values for the utilities they
 * replace, so the rendered result is unchanged.
 */

/* ── Tokens ───────────────────────────────────────────────────────────────── */
:root {
    --mc-accent: #3b82f6;               /* blue-500 — focus ring            */
    --mc-border: #d1d5db;               /* gray-300 — control border        */
    --mc-radius: 0.5rem;                /* rounded-lg                       */
    --mc-radius-lg: 0.75rem;            /* rounded-xl                       */
    --mc-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI',
                 Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Rounded avatars: crop to the face, not the middle of the head. */
img.rounded-full,
.rounded-full > img,
.rounded-full img {
    object-fit: cover;
    object-position: center 15%;
}

.dropdown:hover .dropdown-menu { display: block; }

/* ── Card ─────────────────────────────────────────────────────────────────── */
/* was: bg-white rounded-xl shadow-md — padding stays in the markup */
.card {
    background-color: #fff;
    border-radius: var(--mc-radius-lg);
    box-shadow: var(--mc-shadow-md);
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
/* was: block text-sm font-medium text-gray-700 mb-2 */
.form-label {
    display: block;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* was: w-full px-4 py-2 border border-gray-300 rounded-lg
        focus:ring-2 focus:ring-blue-500 focus:border-transparent */
.form-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius);
}

.form-input:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--mc-accent);
}

/* was: px-3 py-2 text-sm */
.form-input--sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

/* Focus-ring accents. Only the ring colour differs from the base input. */
.form-input--purple { --mc-accent: #a855f7; }   /* purple-500 */
.form-input--red    { --mc-accent: #ef4444; }   /* red-500    */
.form-input--amber  { --mc-accent: #fbbf24; }   /* amber-400  */

/* ── Tables ───────────────────────────────────────────────────────────────── */
/* was: text-left text-xs font-medium text-gray-500 uppercase tracking-wider
        — the padding utilities stay in the markup, they vary per table */
.table-th {
    text-align: left;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Alerts ───────────────────────────────────────────────────────────────── */
/* was: bg-*-100 border border-*-400 text-*-700 px-4 py-3 rounded-lg */
.alert {
    padding: 0.75rem 1rem;
    border: 1px solid;
    border-radius: var(--mc-radius);
}

.alert--error   { background-color: #fee2e2; border-color: #f87171; color: #b91c1c; }
.alert--success { background-color: #dcfce7; border-color: #4ade80; color: #15803d; }
.alert--warning { background-color: #fef9c3; border-color: #facc15; color: #854d0e; }

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
    nav,
    footer,
    .no-print       { display: none !important; }
    .page-break     { page-break-before: always; }
    body            { background: #fff !important; }
}
