/* =====================================================================
   site.css  –  CommodityCatalog.Web  (ALL application styles)
   ===================================================================== */

/* ── Reset / Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    font-family: 'Roboto', "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
    background: #f0f0f0;
    min-width: 900px;
}
a { text-decoration: none; color: inherit; }
a:hover { text-decoration: underline; }

/* ── Page wrapper ──────────────────────────────────────────────────── */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ────────────────────────────────────────────────────────── */
.site-header {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 80px;
    flex-shrink: 0;
}

/* Left side: application title block */
.site-header-appname {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}
.site-header-appname .app-title {
    color: #fff;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1.15;
    font-family: 'Roboto', "Segoe UI", Arial, sans-serif;
}
.site-header-appname .app-subtitle {
    color: #bbb;
    font-size: 11px;
    letter-spacing: 1.2px;
    white-space: nowrap;
    text-transform: uppercase;
    font-weight: 300;
}

/* Right side: Covestro logo + optional admin badge */
.site-header-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    justify-content: center;
}
.site-header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    opacity: 0.92;
    transition: opacity 0.15s;
}
.site-header-logo a:hover { opacity: 1; }
.site-header-logo img {
    height: 72px;
    width: auto;
    display: block;
}

/* ── Admin badge shown in header when admin is authenticated ── */
.admin-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 11px;
    white-space: nowrap;
}
.admin-badge-label {
    color: #ffe082;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.admin-badge-logout {
    color: #ffcdd2;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}
.admin-badge-logout:hover {
    color: #fff;
    text-decoration: underline;
}

/* ── Navigation bar ────────────────────────────────────────────────── */
.site-nav {
    background: #1a1a1a;
    display: flex;
    align-items: stretch;
    height: 36px;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-link {
    display: flex;
    align-items: center;
    padding: 0 14px;
    height: 36px;
    color: #ccc;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    background: transparent;
    text-decoration: none;
    gap: 4px;
}
.nav-link:hover,
.nav-item:hover > .nav-link {
    background: #333;
    color: #fff;
    text-decoration: none;
}
.nav-link.active-nav {
    background: #6a0dad;
    color: #fff;
}
.nav-link.active-nav:hover,
.nav-item:hover > .nav-link.active-nav {
    background: #5a0099;
}
.nav-caret { font-size: 10px; margin-left: 2px; }

/* ── Nav Dropdown ──────────────────────────────────────────────────── */
.nav-dropdown {
    display: none;
    position: absolute;
    top: 36px;
    left: 0;
    min-width: 170px;
    background: #2a2a2a;
    border: 1px solid #444;
    z-index: 200;
    flex-direction: column;
}
.nav-item:hover .nav-dropdown { display: flex; }
.nav-dropdown a {
    display: block;
    padding: 8px 16px;
    color: #ccc;
    font-size: 13px;
    white-space: nowrap;
    text-decoration: none;
}
.nav-dropdown a:hover { background: #444; color: #fff; text-decoration: none; }
.nav-dropdown a.dd-active { background: #6a0dad; color: #fff; }

/* ── Rainbow gradient stripe ───────────────────────────────────────── */
.rainbow-stripe {
    height: 5px;
    background: linear-gradient(to right,
        #e63946 0%, #f4511e 10%, #f9a825 20%, #fdd835 30%,
        #7cb342 40%, #00897b 50%, #039be5 60%, #1e88e5 70%,
        #3949ab 80%, #8e24aa 90%, #e63946 100%);
    flex-shrink: 0;
}

/* ── Main content area ─────────────────────────────────────────────── */
.main-area {
    display: flex;
    flex: 1;
    align-items: flex-start;
}

/* ── Content panel (left/center) ───────────────────────────────────── */
.content-panel {
    flex: 1;
    background: #fff;
    padding: 16px 18px;
    min-height: 500px;
    border-right: 1px solid #ddd;
}

/* ── Sidebar (right) ───────────────────────────────────────────────── */
.sidebar {
    width: 160px;
    background: #fff;
    padding: 14px 10px;
    min-height: 500px;
    flex-shrink: 0;
    border-left: 1px solid #eee;
}
.sidebar-title {
    font-size: 12px;
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
    text-transform: uppercase;
}
.sidebar-links a {
    display: block;
    font-size: 13px;
    color: #333;
    padding: 4px 6px;
    border-radius: 2px;
    text-decoration: none;
    margin-bottom: 2px;
}
.sidebar-links a:hover { background: #e8f4fc; text-decoration: none; }
.sidebar-links a.sb-active {
    background: #009fe4;
    color: #fff;
    font-weight: bold;
}

/* ── Footer ────────────────────────────────────────────────────────── */
.site-footer {
    background: #000;
    color: #aaa;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 32px;
    flex-shrink: 0;
}
.site-footer a { color: #aaa; }
.site-footer a:hover { color: #fff; }
.footer-links { display: flex; gap: 12px; }
.footer-sep { color: #555; }

/* ── Page title ────────────────────────────────────────────────────── */
.page-title {
    color: #009fe4;
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 14px;
}

/* ── Search filter form ────────────────────────────────────────────── */
.search-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
}
.search-filter-bar label {
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
}
.search-filter-bar input[type=text] {
    font-size: 13px;
    padding: 3px 7px;
    border: 1px solid #bbb;
    border-radius: 2px;
    width: 160px;
}

/* ── Advanced search form table ────────────────────────────────────── */
.adv-form-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.adv-form-table td { padding: 5px 8px; vertical-align: middle; }
.adv-form-table .lbl {
    text-align: right;
    font-weight: bold;
    white-space: nowrap;
    width: 145px;
    font-size: 13px;
}
.adv-form-table input[type=text],
.adv-form-table select,
.adv-form-table textarea {
    width: 100%;
    font-size: 13px;
    padding: 3px 6px;
    border: 1px solid #ccc;
    border-radius: 2px;
}
.adv-form-table textarea { resize: vertical; min-height: 58px; }
.adv-form-table .radio-group { margin-top: 4px; font-size: 13px; }
.adv-form-table .radio-group label { font-weight: normal; margin-right: 10px; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn-row { display: flex; gap: 8px; margin: 8px 0 10px; flex-wrap: wrap; align-items: center; }
.btn-cov {
    background: #009fe4;
    color: #fff;
    border: none;
    padding: 6px 22px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 13px;
    font-family: 'Roboto', "Segoe UI", Arial, sans-serif;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.2px;
    transition: background 0.15s;
}
.btn-cov:hover { background: #007bbf; }
.btn-cov:disabled { background: #aaa; cursor: default; }
.btn-cov-outline {
    background: #fff;
    color: #009fe4;
    border: 2px solid #009fe4;
    padding: 5px 20px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 13px;
    font-family: 'Roboto', "Segoe UI", Arial, sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.btn-cov-outline:hover { background: #e8f4fc; }

/* ── Results grid ──────────────────────────────────────────────────── */
.grid-hint { font-size: 12px; margin-bottom: 6px; color: #555; }
.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.results-table thead th {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: left;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.results-table thead th:hover { background: #e8e8e8; }
.results-table tbody tr:nth-child(odd)  { background: #fff; }
.results-table tbody tr:nth-child(even) { background: #f0f6fb; }
.results-table tbody tr:hover           { background: #ddeeff !important; }
.results-table td {
    padding: 5px 8px;
    vertical-align: top;
    border: 1px solid #eee;
}
.col-sapnum      { width: 100px; }
.col-commcode    { width: 130px; }
.col-itemnum     { width: 140px; }
.col-description { min-width: 140; }
.col-potext      { width: 180; min-width: 130px; }
.sort-icon    { font-size: 10px; margin-left: 2px; }

/* Multi-manufacturer row styling */
.multi-mfg-row td { color: blue; }
.sap-link {
    text-decoration: underline;
    cursor: pointer;
    color: #333;
}
.sap-link.multi { color: blue; }

/* Expand toggle */
.expand-toggle {
    cursor: pointer;
    color: #009fe4;
    font-weight: bold;
    user-select: none;
    font-size: 12px;
}

/* Expanded manufacturer sub-row */
.mfg-subrow td { padding: 0; background: #fafafa; }
.mfg-subtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    border: 1px solid #ddd;
}
.mfg-subtable th {
    background: #e0e0e0;
    padding: 4px 8px;
    font-weight: bold;
    border: 1px solid #ccc;
}
.mfg-subtable td {
    padding: 4px 8px;
    border: 1px solid #eee;
}

/* ── Pagination ────────────────────────────────────────────────────── */
.pagination-bar {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}
.pagination-bar .page-info { margin-left: 8px; font-size: 12px; color: #666; }
.pg-btn {
    padding: 3px 9px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 2px;
    cursor: pointer;
    background: #fff;
    color: #333;
    text-decoration: none;
    display: inline-block;
}
.pg-btn:hover { background: #e8e8e8; text-decoration: none; }
.pg-btn.active { background: #009fe4; color: #fff; border-color: #009fe4; }

/* ── No records ────────────────────────────────────────────────────── */
.no-records { color: #888; font-style: italic; padding: 20px 0; }

/* ── Validation summary ────────────────────────────────────────────── */
.val-summary {
    color: #c00;
    font-size: 12px;
    padding: 6px 10px;
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    border-radius: 3px;
    margin-bottom: 8px;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media only screen and (max-device-width: 480px) {
    .sidebar { display: none; }
    .content-panel { padding: 10px; }
}

/* ── Dropdown group labels & divider ───────────────────────────────── */
.dd-group-label {
    padding: 4px 14px 2px;
    font-size: 11px;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: default;
    pointer-events: none;
}
.dd-sub { padding-left: 22px !important; }
.dd-divider {
    border-top: 1px solid #e0e0e0;
    margin: 4px 0;
}

/* ── Sidebar group labels & divider ─────────────────────────────── */
.sb-group-label {
    padding: 6px 10px 2px;
    font-size: 11px;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: default;
}
.sb-divider {
    border-top: 1px solid #e0e0e0;
    margin: 6px 0;
}

/* ── Admin login modal ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-box {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 6px 28px rgba(0,0,0,.25);
    padding: 28px 32px 24px;
    width: 340px;
    max-width: 95vw;
}
.modal-title {
    font-size: 16px;
    font-weight: bold;
    color: #009fe4;
    margin-bottom: 8px;
}

/* ── Form group ─────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.form-group label { font-size: 13px; font-weight: bold; color: #333; }
.form-group input[type="text"],
.form-group input[type="password"] {
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 5px 8px;
    font-size: 14px;
    width: 100%;
}
.form-group input:focus { border-color: #009fe4; outline: none; box-shadow: 0 0 0 2px rgba(0,159,228,.2); }
.field-error { color: #c00; font-size: 12px; }

/* ── Admin login page box ───────────────────────────────────────────── */
.admin-login-box {
    background: #fff;
    border: 1px solid #dde;
    border-radius: 5px;
    padding: 28px 32px;
    max-width: 400px;
    margin: 24px 0;
}
.admin-login-box h3 { color: #009fe4; margin: 0 0 6px; font-size: 15px; }

/* ── Admin error / info banners ─────────────────────────────────────── */
.admin-error {
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    color: #c00;
    border-radius: 3px;
    padding: 6px 10px;
    font-size: 13px;
}
.admin-info {
    background: #f0faf0;
    border: 1px solid #b2dfb2;
    color: #2a7a2a;
    border-radius: 3px;
    padding: 6px 10px;
    font-size: 13px;
    margin-bottom: 10px;
}

/* ── Admin content wrapper ──────────────────────────────────────────── */
.admin-content {
    background: #fff;
    border: 1px solid #dde;
    border-radius: 4px;
    padding: 20px 24px;
    margin-top: 10px;
}

/* ── Delete button ──────────────────────────────────────────────────── */
.btn-delete {
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.btn-delete:hover { background: #f5c6cb; border-color: #c00; color: #c00; }

/* ── Secondary button ───────────────────────────────────────────────── */
.btn-secondary {
    background: #6c757d !important;
}
.btn-secondary:hover { background: #565e64 !important; }

/* ── Content section (report pages) ────────────────────────────────── */
.content-section {
    background: #fff;
    border: 1px solid #dde;
    border-radius: 4px;
    padding: 20px 24px;
    margin-top: 10px;
    color: #444;
    line-height: 1.6;
}

/* ── Administration active highlight in nav ─────────────────────────── */
.admin-active { background: #7b2fbe !important; }

/* ── Admin badge in nav bar (far right) ─────────────────────────────── */
.nav-admin-badge {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: 36px;
    background: rgba(255,255,255,0.08);
    border-left: 1px solid rgba(255,255,255,0.15);
    white-space: nowrap;
}
.nav-admin-label {
    color: #ffe082;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.nav-admin-logout {
    color: #ffcdd2;
    font-size: 12px;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
}
.nav-admin-logout:hover {
    color: #fff;
    text-decoration: underline;
}
