/* DigitalMSDS v0.1 — Light theme, enterprise feel */

:root {
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --red: #dc2626;
    --orange: #ea580c;
    --yellow: #ca8a04;
    --green: #16a34a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 56px;
}
.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo-accent { color: var(--blue); }
.header-search {
    flex: 1;
    max-width: 480px;
    display: flex;
    position: relative;
}
.header-search input {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: .9rem;
    outline: none;
    transition: border-color .15s;
}
.header-search input:focus { border-color: var(--blue); }
.header-search button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
}
.header-nav { display: flex; gap: 1rem; font-size: .9rem; }
.header-nav a { color: var(--gray-600); }
.header-nav a:hover { color: var(--blue); text-decoration: none; }

/* Hero */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}
.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: .5rem;
}
.hero-sub {
    font-size: 1.1rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.hero-search {
    display: flex;
    max-width: 560px;
    margin: 0 auto 1rem;
    gap: .5rem;
}
.hero-search input {
    flex: 1;
    padding: .75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: border-color .15s;
}
.hero-search input:focus { border-color: var(--blue); }
.hero-search button {
    padding: .75rem 1.5rem;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.hero-search button:hover { background: var(--blue-dark); }
.hero-examples {
    font-size: .85rem;
    color: var(--gray-500);
}
.hero-examples a { color: var(--blue); }

/* Stats bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    background: #fff;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue);
}
.stat-label {
    font-size: .8rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Browse section */
.browse-section {
    padding: 2rem 0;
}
.browse-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    color: var(--gray-800);
}
.pictogram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.pictogram-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: .8rem;
    color: var(--gray-600);
    text-align: center;
    transition: box-shadow .15s, border-color .15s;
}
.pictogram-card:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.browse-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}
.btn {
    display: inline-block;
    padding: .5rem 1.25rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}
.btn-outline {
    border: 1px solid var(--blue);
    color: var(--blue);
    background: #fff;
}
.btn-outline:hover {
    background: var(--blue);
    color: #fff;
    text-decoration: none;
}

/* Chemical card (search results) */
.chemical-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.chemical-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: box-shadow .15s;
}
.chemical-card:hover { box-shadow: var(--shadow-md); }
.chemical-card h3 {
    font-size: 1.05rem;
    margin-bottom: .25rem;
}
.card-meta {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .25rem;
}
.card-hazard {
    font-size: .85rem;
    color: var(--gray-600);
    margin: 0;
}
.card-pictograms {
    display: flex;
    gap: .25rem;
    flex-shrink: 0;
}

/* Meta tags */
.meta-tag {
    display: inline-block;
    padding: .1rem .5rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 3px;
    font-size: .8rem;
    color: var(--gray-600);
    font-family: "SF Mono", Monaco, Consolas, monospace;
}
.carcinogen-tag {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--red);
}
.signal-word {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 3px;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.signal-danger {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--red);
}
.signal-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--yellow);
}

/* Chemical detail */
.breadcrumb {
    font-size: .85rem;
    color: var(--gray-500);
    padding: 1rem 0;
}
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--blue); }

.chemical-detail { padding-bottom: 2rem; }

.chem-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.chem-header h1 {
    font-size: 1.5rem;
    margin-bottom: .5rem;
}
.chem-meta {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}
.carcinogen-warning {
    display: inline-block;
    padding: .25rem .75rem;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius);
    color: var(--red);
    font-weight: 600;
    font-size: .85rem;
    margin-top: .5rem;
}
.chem-pictograms {
    display: flex;
    gap: .75rem;
    flex-shrink: 0;
}
.pictogram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    font-size: .75rem;
    color: var(--gray-500);
}

.detail-section {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.detail-section h2 {
    font-size: 1.1rem;
    color: var(--gray-800);
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--gray-100);
}

/* Data table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.data-table th {
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    padding: .5rem .75rem;
    border-bottom: 2px solid var(--gray-200);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.data-table td {
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
}
.data-table code {
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-size: .85rem;
    color: var(--blue);
}
.data-table tbody tr:hover { background: var(--gray-50); }

/* Browse table */
.browse-table { margin-top: .5rem; }

/* Letter nav */
.letter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-bottom: 1.5rem;
}
.letter-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: .85rem;
    color: var(--gray-600);
    background: #fff;
}
.letter-link:hover {
    border-color: var(--blue);
    color: var(--blue);
    text-decoration: none;
}
.letter-link.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

/* NFPA Diamond */
.nfpa-diamond {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 1rem auto;
}
.nfpa-diamond > div {
    position: absolute;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
    transform: rotate(45deg);
}
.nfpa-diamond > div > * { transform: rotate(-45deg); }
.nfpa-top { top: 0; left: 40px; background: #ef4444; color: #fff; }
.nfpa-left { top: 40px; left: 0; background: #3b82f6; color: #fff; }
.nfpa-right { top: 40px; left: 80px; background: #eab308; }
.nfpa-bottom { top: 80px; left: 40px; background: #fff; border: 2px solid var(--gray-300); }
.nfpa-labels {
    position: absolute;
    bottom: -2rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: .7rem;
    color: var(--gray-500);
}

/* Organ tags */
.organ-tags {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}
.organ-tag {
    padding: .25rem .75rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    font-size: .85rem;
    color: var(--gray-700);
}
.health-basis { font-size: .9rem; color: var(--gray-600); font-style: italic; }
.phys-desc { font-size: .9rem; color: var(--gray-600); margin-bottom: .75rem; font-style: italic; }
.synonyms-text { font-size: .9rem; color: var(--gray-600); word-break: break-word; }

/* Disclaimer */
.disclaimer-box {
    padding: 1rem 1.25rem;
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: var(--radius);
    font-size: .85rem;
    color: var(--gray-700);
    margin-top: 1.5rem;
}
.disclaimer-box p { margin-bottom: .5rem; }
.disclaimer-box p:last-child { margin-bottom: 0; }

/* Sources section */
.sources-section ul {
    list-style: none;
    padding: 0;
}
.sources-section li {
    padding: .25rem 0;
    font-size: .9rem;
}

/* Hazard header (browse by hazard) */
.hazard-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.hazard-header h1 { margin-bottom: 0; }
.section-desc { color: var(--gray-600); margin-bottom: 1rem; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .25rem;
    margin: 1.5rem 0;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 .5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: .85rem;
    color: var(--gray-600);
    background: #fff;
}
.page-link:hover {
    border-color: var(--blue);
    color: var(--blue);
    text-decoration: none;
}
.page-link.current {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}
.page-dots { color: var(--gray-400); padding: 0 .25rem; }

/* Results count */
.results-count {
    color: var(--gray-600);
    margin-bottom: 1rem;
}

/* Search page */
.search-page { padding: 1.5rem 0; }
.search-page h1 { font-size: 1.3rem; margin-bottom: .5rem; }
.browse-page { padding: 1.5rem 0; }
.browse-page h1 { font-size: 1.3rem; margin-bottom: 1rem; }
.browse-subtitle { color: var(--gray-600); margin-bottom: 1.5rem; line-height: 1.5; }
.mfr-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.mfr-section { margin-bottom: 2.5rem; }
.mfr-section h2 { font-size: 1.15rem; margin-bottom: .25rem; }
.mfr-section > p { color: var(--gray-500); font-size: .85rem; margin-bottom: .75rem; }
.mfr-cta { text-align: center; padding: 2rem 1rem; background: var(--gray-50); border-radius: var(--radius); }
.mfr-cta h2 { margin-bottom: .5rem; }
.mfr-cta p { color: var(--gray-600); margin-bottom: 1rem; }
.supplier-letter-nav { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: 1rem; }
.supplier-letter-nav .btn-xs { padding: .15rem .5rem; font-size: .75rem; border: 1px solid var(--gray-300); border-radius: var(--radius); background: #fff; color: var(--gray-600); }
.supplier-letter-nav .btn-xs:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.supplier-letter-nav .btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.supplier-count { font-size: .85rem; color: var(--gray-500); margin-bottom: .75rem; }
.about-page { padding: 1.5rem 0; }
.about-page h1 { font-size: 1.5rem; margin-bottom: 1rem; }
.about-page .detail-section { margin-bottom: 1rem; }

/* Autocomplete */
.autocomplete-wrapper { position: relative; }
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 200;
    max-height: 300px;
    overflow-y: auto;
}
.autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem .75rem;
    font-size: .9rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
}
.autocomplete-item:hover { background: var(--gray-50); }
.autocomplete-item:last-child { border-bottom: none; }

/* Footer */
.site-footer {
    background: var(--gray-800);
    color: var(--gray-300);
    padding: 2rem 0;
    margin-top: 3rem;
    font-size: .85rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
}
.footer-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: .25rem;
}
.footer-copy { font-size: .8rem; color: var(--gray-400); }
.footer-heading {
    font-weight: 600;
    color: #fff;
    margin-bottom: .5rem;
}
.site-footer a {
    display: block;
    color: var(--gray-300);
    margin-bottom: .25rem;
}
.site-footer a:hover { color: #fff; }
.footer-disclaimer { font-size: .8rem; color: var(--gray-400); }

/* Messages */
.messages { margin: 1rem 0; }
.message {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .9rem;
    margin-bottom: .5rem;
}
.message-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.message-error { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--red); }
.message-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.message-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: #92400e; }

/* Auth pages */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 2rem;
}
.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: .5rem;
}
.auth-subtitle {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    font-size: .9rem;
}
.auth-links {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
}
.auth-links a { color: var(--blue); }

/* Forms */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: .25rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: .9rem;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--blue);
}
.form-group input:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-errors {
    padding: .75rem 1rem;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius);
    color: var(--red);
    font-size: .85rem;
    margin-bottom: 1rem;
}
.field-error {
    color: var(--red);
    font-size: .8rem;
    margin-top: .25rem;
}
.field-help {
    color: var(--gray-500);
    font-size: .8rem;
    margin-top: .25rem;
}
.form-actions {
    display: flex;
    gap: .75rem;
    align-items: center;
    margin-top: 1.5rem;
}

/* Buttons */
.btn-primary {
    background: var(--blue);
    color: #fff;
    border: 1px solid var(--blue);
}
.btn-primary:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    text-decoration: none;
}
.btn-full { width: 100%; text-align: center; }
.btn-danger {
    background: var(--red);
    color: #fff;
    border: 1px solid var(--red);
}
.btn-danger:hover { background: #b91c1c; text-decoration: none; }
.btn-danger-outline {
    background: #fff;
    color: var(--red);
    border: 1px solid var(--red);
}
.btn-danger-outline:hover {
    background: var(--danger-bg);
    text-decoration: none;
}
.btn-sm {
    display: inline-block;
    padding: .2rem .5rem;
    font-size: .8rem;
    border: 1px solid var(--gray-300);
    border-radius: 3px;
    color: var(--gray-600);
    background: #fff;
}
.btn-sm:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.btn-primary-sm {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
    display: inline-block;
    padding: .2rem .5rem;
    font-size: .8rem;
    border-radius: 3px;
}
.btn-primary-sm:hover { background: var(--blue-dark); text-decoration: none; }
.btn-danger-sm { color: var(--red); border-color: var(--danger-border); }
.btn-danger-sm:hover { background: var(--danger-bg); color: var(--red); }

/* Dashboard layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
    padding: 1.5rem 0;
    min-height: calc(100vh - 200px);
}

/* Sidebar */
.dashboard-sidebar {
    border-right: 1px solid var(--gray-200);
    padding-right: 1.5rem;
}
.sidebar-nav ul {
    list-style: none;
    padding: 0;
}
.sidebar-company {
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-900);
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--gray-200);
}
.sidebar-nav a {
    display: block;
    padding: .4rem .75rem;
    color: var(--gray-600);
    border-radius: var(--radius);
    font-size: .9rem;
    margin-bottom: .15rem;
}
.sidebar-nav a:hover { background: var(--gray-100); color: var(--gray-900); text-decoration: none; }
.sidebar-nav a.active { background: var(--blue); color: #fff; }
.sidebar-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}
.sidebar-link {
    display: block;
    padding: .3rem 0;
    color: var(--gray-500);
    font-size: .85rem;
}
.sidebar-link:hover { color: var(--blue); }
.logout-form { display: inline; }
.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    padding: .3rem 0;
}

/* Dashboard content */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}
.dash-header h1 {
    font-size: 1.5rem;
    margin: 0;
}
.dash-header-actions {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}
.dash-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.dash-card h2 {
    font-size: 1.1rem;
    margin-bottom: .75rem;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5rem;
}
.card-header h2 { margin-bottom: 0; }

/* Dashboard stats */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.dash-stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}
.dash-stat-num {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--blue);
}
.dash-stat-label {
    display: block;
    font-size: .8rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.dash-stat-limit {
    font-size: .8rem;
    color: var(--gray-400);
}
.dash-actions {
    display: flex;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}
.empty-state h2 {
    font-size: 1.2rem;
    margin-bottom: .5rem;
}
.empty-state p {
    color: var(--gray-600);
    margin-bottom: 1rem;
}
.empty-state-inline {
    padding: 1.5rem;
    text-align: center;
    color: var(--gray-500);
}
.empty-state-inline p { margin-bottom: .75rem; }

/* Binder grid */
.binder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.binder-card {
    display: block;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: box-shadow .15s, border-color .15s;
}
.binder-card:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.binder-card h3 {
    font-size: 1.1rem;
    color: var(--gray-900);
    margin-bottom: .25rem;
}
.binder-desc {
    font-size: .85rem;
    color: var(--gray-600);
    margin-bottom: .5rem;
}
.binder-meta {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--gray-400);
}
.binder-count { color: var(--gray-600); }
.binder-info-bar {
    display: flex;
    gap: 2rem;
    font-size: .8rem;
    color: var(--gray-400);
    padding: 1rem 0;
}

/* Table actions */
.actions {
    text-align: right;
    white-space: nowrap;
}
.actions .btn-sm { margin-left: .25rem; }

/* Role badges */
.role-badge {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 3px;
    font-size: .8rem;
    font-weight: 500;
    text-transform: capitalize;
}
.role-owner { background: #dbeafe; color: #1e40af; }
.role-admin { background: #fef3c7; color: #92400e; }
.role-member { background: var(--gray-100); color: var(--gray-600); }

/* Plan info */
.plan-info { margin-bottom: 1rem; }
.plan-info h2 { margin-bottom: .75rem; }
.plan-limits {
    display: flex;
    gap: 2rem;
}
.plan-limit {
    display: flex;
    flex-direction: column;
}
.plan-limit-label {
    font-size: .8rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.plan-limit-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gray-800);
}
.plan-upgrade-note {
    font-size: .9rem;
    color: var(--gray-600);
    padding: .75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

/* Ad slots */
.ad-slot { text-align: center; margin: 1rem 0; }

/* Responsive — tablets and large phones */
@media (max-width: 768px) {
    .header-inner { height: auto; flex-wrap: wrap; padding: .5rem 0; gap: .5rem; }
    .header-search { order: 3; max-width: none; flex-basis: 100%; }
    .header-nav { font-size: .85rem; gap: .75rem; }
    .hero { padding: 2rem 0 1.5rem; }
    .hero h1 { font-size: 1.5rem; }
    .hero-search { flex-direction: column; }
    .hero-search input, .hero-search button { padding: .75rem 1rem; font-size: 1rem; }
    .stats-bar { gap: 1rem; padding: 1rem; }
    .stat-num { font-size: 1.2rem; }
    .chem-header { flex-direction: column; }
    .chem-pictograms { flex-wrap: wrap; }
    .chem-pictograms .pictogram img { width: 56px; height: 56px; }
    .footer-grid { grid-template-columns: 1fr; gap: 1rem; }
    .chemical-card { flex-direction: column; }
    .letter-nav { gap: .15rem; }
    .letter-link { width: 1.75rem; height: 1.75rem; font-size: .75rem; }
    .pictogram-grid { grid-template-columns: repeat(3, 1fr); }
    .pictogram-card img { width: 56px; height: 56px; }
    .dashboard-layout { grid-template-columns: 1fr; }
    .dashboard-sidebar { border-right: none; border-bottom: 1px solid var(--gray-200); padding-right: 0; padding-bottom: 1rem; }
    .sidebar-nav ul { display: flex; flex-wrap: wrap; gap: .25rem; }
    .sidebar-nav a { padding: .4rem .6rem; font-size: .85rem; }
    .sidebar-footer { display: flex; gap: 1rem; margin-top: 1rem; }
    .dash-header { flex-direction: column; }
    .form-row { grid-template-columns: 1fr; }
    .form-group input, .form-group select, .form-group textarea { padding: .65rem .75rem; font-size: 1rem; }
    .binder-grid { grid-template-columns: 1fr; }
    .dash-stats { grid-template-columns: 1fr 1fr; }
    .binder-info-bar { flex-direction: column; gap: .25rem; }
    .data-table { font-size: .8rem; }
    .data-table th, .data-table td { padding: .4rem .5rem; }
    .detail-section { padding: 1rem; }
    .browse-section h2 { font-size: 1.1rem; }
    .browse-links { flex-direction: column; align-items: center; gap: .5rem; }
    .plan-limits { flex-direction: column; gap: .75rem; }
    .emergency-bar { font-size: .8rem; }
    .disclaimer-box { font-size: .8rem; }
    .btn { padding: .6rem 1rem; }
}

/* Small phones */
@media (max-width: 420px) {
    .container { padding: 0 .75rem; }
    .hero h1 { font-size: 1.25rem; }
    .hero-sub { font-size: .95rem; }
    .stats-bar { gap: .5rem; padding: .75rem .5rem; }
    .stat-num { font-size: 1rem; }
    .stat-label { font-size: .7rem; }
    .pictogram-grid { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
    .pictogram-card { padding: .5rem; font-size: .7rem; }
    .pictogram-card img { width: 44px; height: 44px; }
    .chem-pictograms .pictogram img { width: 44px; height: 44px; }
    .chem-header { padding: 1rem; }
    .chem-header h1 { font-size: 1.2rem; }
    .meta-tag { font-size: .7rem; padding: .1rem .35rem; }
    .chemical-card { padding: .75rem; }
    .chemical-card h3 { font-size: .95rem; }
    .dash-stats { grid-template-columns: 1fr; }
    .section-label, .section-title { font-size: .9rem; }
    .nfpa-diamond { width: 120px; height: 120px; }
    .nfpa-diamond > div { width: 60px; height: 60px; font-size: 1.1rem; }
    .nfpa-top { left: 30px; }
    .nfpa-left { top: 30px; }
    .nfpa-right { top: 30px; left: 60px; }
    .nfpa-bottom { top: 60px; left: 30px; }
    .auth-card { padding: 1.25rem; }
}

/* Emergency contact bar */
.emergency-bar {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: .6rem 1rem;
    margin: 1rem 0;
    font-size: .9rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
}
.emergency-bar strong { color: var(--red); }
.emergency-bar a { color: var(--red); font-weight: 600; text-decoration: none; }
.emergency-bar a:hover { text-decoration: underline; }
.emergency-sep { color: var(--gray-300); margin: 0 .25rem; }
.settings-section-heading { margin: 1.5rem 0 .75rem; padding-top: 1rem; border-top: 1px solid var(--gray-200); font-size: 1rem; color: var(--gray-700); }
.form-select-sm { padding: .25rem .5rem; border: 1px solid var(--gray-300); border-radius: 4px; font-size: .8rem; background: #fff; max-width: 180px; }
.inline-form { display: inline; }
.binder-checklist ul { list-style: none; padding: 0; margin: .5rem 0; }
.binder-checklist li { padding: .35rem 0; }
.binder-checklist label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; }
.binder-checklist input[type="checkbox"] { margin: 0; }
.mini-pagination { display: flex; gap: .5rem; align-items: center; justify-content: center; margin-top: 1rem; font-size: .85rem; }
.mini-pagination a { color: var(--blue); text-decoration: none; padding: .25rem .5rem; border: 1px solid var(--gray-200); border-radius: 4px; }
.mini-pagination a:hover { background: var(--gray-50); }
.mini-pagination .current { padding: .25rem .5rem; background: var(--blue); color: #fff; border-radius: 4px; }
.mini-pagination .disabled { color: var(--gray-400); padding: .25rem .5rem; }

/* SDS section highlight on chemical detail page */
.sds-section {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 1.25rem;
}
.sds-section h2 { margin-top: 0; color: var(--blue-dark); }

/* Reference SDS picker in entry form */
.form-select {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: .9rem;
    background: #fff;
    margin: .5rem 0;
}
.form-select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.sds-upload-sublabel {
    font-size: .85rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-top: .75rem;
    display: block;
}

/* Pending count badge */
.badge {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    padding: .1rem .45rem;
    border-radius: 10px;
    line-height: 1.3;
    vertical-align: middle;
    margin-left: .25rem;
}

/* Suggestion rows */
.suggestion-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}
.suggestion-row:last-child { border-bottom: none; }
.suggestion-info { flex: 1; }
.suggestion-reason {
    margin-top: .35rem;
    font-size: .85rem;
    color: var(--gray-600);
}
.suggestion-actions {
    display: flex;
    gap: .35rem;
    align-items: center;
    flex-shrink: 0;
    margin-left: 1rem;
}
.suggestion-reviewed { opacity: .7; }
.suggestion-status {
    display: inline-block;
    padding: .1rem .4rem;
    border-radius: 3px;
    font-size: .75rem;
    font-weight: 500;
}
.suggestion-status-approved { background: #dcfce7; color: #166534; }
.suggestion-status-rejected { background: var(--danger-bg); color: var(--red); }

/* Meta tags for suggestions */
.meta-tag-warn { background: var(--warning-bg); border-color: var(--warning-border); color: #92400e; }

/* Report issue form page */
.form-page {
    max-width: 600px;
    margin: 2rem auto;
}
.form-page h1 {
    margin-bottom: .5rem;
}
.form-subtitle {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

@media print {
    .site-header, .site-footer, .ad-slot, .hero-search,
    .header-search, .breadcrumb, .pagination, .browse-links { display: none; }
    body { background: #fff; }
    .detail-section { break-inside: avoid; border: 1px solid #ccc; }
}
