/* TimberSwitch base styles + legacy component class overrides.
   The inherited Blazor pages reference .card, .btn-*, .form-*, .alert-* classes
   directly; here we redefine those to use the moss/slate timber tokens so
   non-restyled pages still pick up the brand. */

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

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
    margin: 0;
    line-height: inherit;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #0f172a;
    background: #f1f5f9;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
    margin: 0;
}

a { color: inherit; text-decoration: inherit; }

/* Cleaner focus — moss outline instead of browser default */
*:focus, *:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
}

img, svg { display: block; max-width: 100%; }

/* ----- Utility classes (subset of Tailwind kept for self-built pages) ----- */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-8 > * + * { margin-left: 2rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.grid { display: grid; }

.w-5 { width: 1.25rem; } .w-full { width: 100%; } .w-64 { width: 16rem; }
.h-5 { height: 1.25rem; } .h-16 { height: 4rem; }
.max-w-md { max-width: 28rem; } .max-w-7xl { max-width: 80rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.ml-64 { margin-left: 16rem; } .ml-8 { margin-left: 2rem; } .mr-3 { margin-right: 0.75rem; }
.mt-auto { margin-top: auto; }
.mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }

.p-4 { padding: 1rem; } .p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; } .px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; } .py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; } .py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }

.text-white { color: #ffffff; }
.text-gray-400 { color: #94a3b8; }
.text-gray-500 { color: #64748b; }
.text-gray-600 { color: #475569; }
.text-gray-700 { color: #334155; }
.text-gray-900 { color: #0f172a; }
.text-sky-600 { color: #3d6a35; }
.text-sky-700 { color: #2c4f25; }
.text-red-600 { color: #dc2626; }
.text-green-600 { color: #3d6a35; }

.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f8fafc; }
.bg-gray-100 { background-color: #f1f5f9; }
.bg-gray-700 { background-color: #334155; }
.bg-gray-800 { background-color: #1e293b; }
.bg-gray-900 { background-color: #0f172a; }
.bg-sky-600 { background-color: #3d6a35; }
.bg-sky-700 { background-color: #2c4f25; }
.bg-red-50 { background-color: #fef2f2; }
.bg-green-50 { background-color: rgba(90,133,80,0.08); }

.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-gray-200 { border-color: rgba(15,23,42,0.08); }
.border-gray-300 { border-color: rgba(15,23,42,0.12); }
.border-gray-700 { border-color: #334155; }
.border-red-300 { border-color: #fca5a5; }
.border-green-300 { border-color: #a3c293; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(15,23,42,0.04); }
.shadow { box-shadow: 0 1px 3px 0 rgba(15,23,42,0.06), 0 1px 2px -1px rgba(15,23,42,0.06); }
.shadow-lg { box-shadow: 0 10px 18px -3px rgba(15,23,42,0.06), 0 4px 6px -4px rgba(15,23,42,0.04); }

.fixed { position: fixed; }
.inset-y-0 { top: 0; bottom: 0; }
.left-0 { left: 0; }

/* ----- Component classes (timber-themed) ----- */
.form-input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.4;
    color: #0f172a;
    background-color: #ffffff;
    border: 0.5px solid rgba(15,23,42,0.08);
    border-radius: 6px;
    font-family: inherit;
    transition: border-color 0.12s;
}
.form-input:focus { outline: none; border-color: #5a8550; }

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 7px;
    transition: background 0.12s, border-color 0.12s;
    cursor: pointer;
    border: 0.5px solid rgba(15,23,42,0.08);
    background: #ffffff;
    color: #334155;
    font-family: inherit;
    text-decoration: none;
}
.btn:hover { border-color: #64748b; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}
.btn-primary:hover { background: #1e293b; border-color: #1e293b; }

.btn-secondary {
    background: #ffffff;
    color: #334155;
    border: 0.5px solid rgba(15,23,42,0.08);
}
.btn-secondary:hover { background: #f8fafc; border-color: #64748b; }

.btn-danger {
    background: #ffffff;
    color: #dc2626;
    border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.06); }

.btn-moss {
    background: #5a8550;
    color: #ffffff;
    border-color: #5a8550;
}
.btn-moss:hover { background: #3d6a35; border-color: #3d6a35; }

/* Public-page nav link (used in MainLayout etc.) */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    border-bottom: 2px solid transparent;
    text-decoration: none;
}
.nav-link:hover { color: #0f172a; border-bottom-color: rgba(15,23,42,0.12); }
.nav-link.active { color: #3d6a35; border-bottom-color: #5a8550; }

/* Old admin sidebar link (kept for backwards compat — replaced by ts-shell-nav) */
.admin-nav-link {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(203,213,225,0.75);
    border-radius: 6px;
    transition: background 0.15s;
    text-decoration: none;
    gap: 10px;
}
.admin-nav-link:hover { color: #f1f5f9; background: rgba(90,133,80,0.1); }
.admin-nav-link.active { color: #f1f5f9; background: rgba(90,133,80,0.18); }

.account-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    color: #475569;
    font-weight: 500;
    transition: background 0.15s;
    text-decoration: none;
    font-size: 13px;
}
.account-nav-link:hover { background: rgba(15,23,42,0.04); color: #0f172a; }
.account-nav-link.active { background: rgba(90,133,80,0.18); color: #0f172a; }

/* Card */
.card {
    background-color: #ffffff;
    border-radius: 9px;
    border: 0.5px solid rgba(15,23,42,0.08);
    box-shadow: none;
    overflow: hidden;
}
.card-header {
    padding: 14px 18px;
    border-bottom: 0.5px solid rgba(15,23,42,0.04);
}
.card-body { padding: 18px; }

/* Alerts */
.alert {
    padding: 12px 14px;
    border-radius: 7px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.5;
    border: 0.5px solid;
}
.alert-error {
    background: rgba(239,68,68,0.06);
    border-color: rgba(239,68,68,0.25);
    color: #991b1b;
}
.alert-success {
    background: rgba(90,133,80,0.08);
    border-color: rgba(90,133,80,0.25);
    color: #3d6a35;
}

/* Responsive helpers */
@media (min-width: 640px) {
    .sm\:flex { display: flex; }
    .sm\:ml-8 { margin-left: 2rem; }
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}
