/* Hand-written base stylesheet (no build step). Mirrors the look of the B2B portal. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif; background: #f3f4f6; color: #111827; display: flex; flex-direction: column; min-height: 100vh; }

/* Shell */
.shell { display: flex; flex: 1; min-height: 0; }

/* Sidebar */
.sidebar { width: 240px; background: #1b1b18; color: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-brand { padding: 1.25rem 1.5rem; font-size: 1rem; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255,255,255,.15); letter-spacing: .01em; }
.sidebar-nav { flex: 1; padding: .75rem 0; }
.sidebar-nav a { display: flex; align-items: center; gap: .625rem; padding: .5rem 1.5rem; font-size: .875rem; color: #fff; text-decoration: none; border-left: 3px solid transparent; transition: background .15s, color .15s; }
.sidebar-nav a:hover { background: rgba(255,255,255,.10); color: #fff; }
.sidebar-nav a.active { background: rgba(255,255,255,.15); color: #fff; border-left-color: #6366f1; }
.sidebar-nav .nav-icon { width: 1rem; height: 1rem; flex-shrink: 0; }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,.15); }
.sidebar-footer span { display: block; font-size: .75rem; color: #fff; margin-bottom: .5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer button { width: 100%; background: none; border: 1px solid rgba(255,255,255,.25); border-radius: .375rem; padding: .375rem .75rem; font-size: .8125rem; color: #fff; cursor: pointer; }
.sidebar-footer button:hover { background: rgba(255,255,255,.10); }

/* Content */
.content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }
.content-header { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 1rem 2rem; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.content-header h1 { font-size: 1.125rem; font-weight: 600; color: #111827; }
.content-header-actions { display: flex; align-items: center; gap: .75rem; margin-left: auto; flex-shrink: 0; }
.content-body { flex: 1; padding: 2rem; }

/* Mobile topbar */
.mobile-topbar { display: none; }

/* Backdrop */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.sidebar-backdrop.visible { display: block; }

@media (max-width: 768px) {
    .mobile-topbar { display: flex; align-items: center; justify-content: space-between; padding: .875rem 1rem; background: #1b1b18; color: #fff; position: sticky; top: 0; z-index: 30; flex-shrink: 0; }
    .mobile-topbar-brand { font-size: .9375rem; font-weight: 600; letter-spacing: .01em; }
    .mobile-topbar button { background: none; border: none; color: #fff; cursor: pointer; padding: .25rem; display: flex; align-items: center; }

    .shell { position: relative; }
    .sidebar { position: fixed; top: 0; left: 0; height: 100%; z-index: 50; transform: translateX(-100%); transition: transform .25s ease; }
    .sidebar.open { transform: translateX(0); }

    .content-header { padding: .875rem 1rem; position: static; }
    .content-body { padding: 1rem; }

    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
}

/* Guest (login) card */
body.guest { align-items: center; justify-content: center; background: #f9fafb; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: .75rem; padding: 2.5rem; width: 100%; max-width: 24rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card-logo { display: block; margin: 0 auto 1.5rem; max-width: 180px; height: auto; }
.field { margin-bottom: 1rem; }
.field label, .remember label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .375rem; color: #374151; }
.field input[type="text"], .field input[type="email"], .field input[type="password"] { width: 100%; border: 1px solid #d1d5db; border-radius: .375rem; padding: .5rem .75rem; font-size: .875rem; outline: none; }
.field input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.error { color: #dc2626; font-size: .8125rem; margin-top: .25rem; }
.remember { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.remember label { margin-bottom: 0; }
.btn { width: 100%; background: #1b1b18; color: #fff; border: none; border-radius: .375rem; padding: .625rem 1rem; font-size: .875rem; font-weight: 500; cursor: pointer; }
.btn:hover { background: #2d2d28; }

/* Dashboard tiles */
.page-intro { color: #6b7280; font-size: .875rem; margin-bottom: 1.75rem; }
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-tile { display: flex; align-items: flex-start; gap: .875rem; background: #fff; border: 1px solid #e5e7eb; border-left: 4px solid #6366f1; border-radius: .5rem; padding: 1.125rem 1.25rem; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.dash-tile:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
.dash-icon { width: 40px; height: 40px; border-radius: .5rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #eef2ff; }
.dash-title { font-size: .9375rem; font-weight: 600; color: #111827; margin-bottom: .2rem; }
.dash-desc { font-size: .8125rem; color: #6b7280; line-height: 1.4; }

/* Alerts */
.alert { border-radius: .375rem; padding: .75rem 1rem; font-size: .875rem; margin-bottom: 1.25rem; border: 1px solid transparent; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Buttons (inline) */
.button { display: inline-block; background: #1b1b18; color: #fff; border: 1px solid #1b1b18; border-radius: .375rem; padding: .5rem 1rem; font-size: .875rem; font-weight: 500; text-decoration: none; cursor: pointer; font-family: inherit; }
.button:hover { background: #2d2d28; }
.button-secondary { background: #fff; color: #374151; border-color: #d1d5db; }
.button-secondary:hover { background: #f9fafb; }
.button-danger { background: #fff; color: #b91c1c; border-color: #fecaca; }
.button-danger:hover { background: #fef2f2; }
.button-sm { padding: .25rem .625rem; font-size: .8125rem; }

/* Panels, forms and tables */
.panel { background: #fff; border: 1px solid #e5e7eb; border-radius: .5rem; padding: 1.5rem; max-width: 32rem; }
.panel + .panel { margin-top: 1.5rem; }
.panel h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.form-actions { display: flex; align-items: center; gap: .5rem; margin-top: 1.25rem; }
.hint { color: #6b7280; font-size: .8125rem; margin-top: .25rem; }
.field label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; margin-bottom: .25rem; cursor: pointer; }
.table-wrap { background: #fff; border: 1px solid #e5e7eb; border-radius: .5rem; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { text-align: left; font-weight: 600; color: #6b7280; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; padding: .75rem 1rem; border-bottom: 1px solid #e5e7eb; background: #f9fafb; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .row-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.badge { display: inline-block; background: #eef2ff; color: #4338ca; border-radius: 9999px; font-size: .6875rem; font-weight: 600; padding: .1rem .5rem; margin-left: .375rem; }
