
/* ================================================
   MTrackR Industrial Corporate Theme
   Unified Alloys inspired — deep navy + corporate blue
   Used by: MTRSEARCH, CORPLOGIN (and future corp pages)
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
    --c-navy: #0a1a2f;          /* utility bar / footer / table head */
    --c-navy-dark: #06111f;     /* darker hover */
    --c-blue: #1b6ec2;          /* primary accent (buttons, links) */
    --c-blue-dark: #155a9e;     /* accent hover */
    --c-blue-light: #4a90d9;    /* light accent (arrows on dark) */
    --c-bg: #f4f6f8;
    --c-surface: #ffffff;
    --c-border: #d1d5db;
    --c-border-light: #e5e7eb;
    --c-text: #1f2a37;
    --c-text-muted: #4b5563;
    --c-text-soft: #6b7280;
    --c-row-alt: #f9fafb;
    --c-row-hover: #eef4fb;

    --font-head: 'Oswald', 'Arial Narrow', Arial, sans-serif;
    --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

html { height: 100%; }
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background: var(--c-bg);
    color: var(--c-text);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--c-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ====== Layout containers ====== */
.container-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.page-body { padding: 32px 0 64px; }

/* ====== Top utility bar ====== */
.utility-bar {
    background: var(--c-navy);
    color: #fff;
    font-size: 12px;
    padding: 8px 0;
}
.utility-bar .container-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.utility-bar a { color: #fff; }

/* ====== Main header ====== */
.site-header {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border-light);
    padding: 16px 0;
}
.site-header .container-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.brand img { height: 44px; display: block; }
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.brand-text .brand-name {
    font-family: var(--font-head);
    font-size: 24px;
    font-weight: 700;
    color: var(--c-navy);
    letter-spacing: 0.01em;
    text-transform: uppercase;
}
.brand-text .brand-tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--c-text-soft);
    margin-top: 2px;
}
.top-user {
    font-size: 13px;
    color: var(--c-text-muted);
}
.top-user strong { color: var(--c-navy); }

/* ====== Page banner ====== */
.page-banner {
    background: linear-gradient(rgba(10,26,47,0.86), rgba(10,26,47,0.94)),
                url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60"><path d="M0 30h60M30 0v60" stroke="%23ffffff" stroke-opacity="0.05" stroke-width="1"/></svg>') var(--c-navy);
    color: #fff;
    padding: 46px 0;
    border-bottom: 3px solid var(--c-blue);
}
.page-banner .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--c-blue-light);
    margin-bottom: 10px;
}
.page-banner .eyebrow::before {
    content: '';
    width: 26px;
    height: 2px;
    background: var(--c-blue-light);
    display: inline-block;
}
.page-banner h1 {
    font-family: var(--font-head);
    font-size: 40px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1.05;
}
.page-banner .subtitle {
    font-size: 14px;
    color: #b7c4d4;
    margin-top: 10px;
    letter-spacing: 0.02em;
}

/* ====== Section headings ====== */
.section-title {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 600;
    color: var(--c-navy);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--c-blue);
}

/* ====== Cards ====== */
.corp-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-top: 3px solid var(--c-blue);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.corp-card-flat {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ====== Form fields ====== */
.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-navy);
}
.field-group input,
.field-group select,
.field-group textarea {
    background: var(--c-surface);
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    padding: 9px 11px;
    color: var(--c-text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    outline: none;
    border-color: var(--c-blue);
    box-shadow: 0 0 0 3px rgba(27, 110, 194, 0.15);
}
.date-range { display: flex; gap: 10px; align-items: center; }
.date-range input { flex: 1; }
.date-range span { color: var(--c-text-soft); font-size: 12px; font-weight: 600; }

/* ====== Form actions row ====== */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 18px;
    border-top: 1px solid var(--c-border-light);
}

/* ====== Buttons ====== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid transparent;
    transition: all 0.15s;
}
.btn-primary {
    background: var(--c-blue);
    color: #fff;
    border-color: var(--c-blue);
}
.btn-primary:hover {
    background: var(--c-blue-dark);
    border-color: var(--c-blue-dark);
    color: #fff;
    text-decoration: none;
}
.btn-secondary {
    background: var(--c-surface);
    color: var(--c-navy);
    border-color: #cbd5e1;
}
.btn-secondary:hover {
    background: var(--c-bg);
    border-color: #9ca3af;
    text-decoration: none;
}
.btn-block { width: 100%; justify-content: center; padding: 13px 24px; font-size: 14px; }
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    background: var(--c-blue);
    border: 1px solid var(--c-blue);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.15s;
}
.btn-download:hover {
    background: var(--c-blue-dark);
    border-color: var(--c-blue-dark);
    color: #fff;
    text-decoration: none;
}
.btn-download svg { width: 12px; height: 12px; }
button[disabled] { cursor: not-allowed; opacity: 0.65; }

/* ====== Results header ====== */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--c-row-alt);
    border-bottom: 1px solid var(--c-border-light);
}
.results-header h2 {
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 600;
    color: var(--c-navy);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}
.results-count {
    color: var(--c-text-muted);
    font-size: 13px;
    font-weight: 600;
}
.results-count strong { color: var(--c-blue); }

/* ====== Data tables ====== */
.corp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.corp-table th {
    background: var(--c-navy);
    color: #fff;
    padding: 11px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-right: 1px solid rgba(255,255,255,0.08);
}
.corp-table th:last-child { border-right: none; }

/* Sortable column headers (click to sort).
   Uses data-sort attribute on the <th>; JS in mtrsearch.html attaches click handlers.
   Active column shows a red ? / ? arrow; inactive shows a dim ? to hint sortability. */
.corp-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 26px;
    transition: background-color 0.12s;
}
.corp-table th.sortable:hover { background: var(--c-navy-dark); }
.corp-table th.sortable .sort-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.35;
    transition: opacity 0.12s, color 0.12s;
}
.corp-table th.sortable.sort-active .sort-indicator {
    opacity: 1;
    color: var(--c-blue-light); /* readable on navy */
}
.corp-table th.sortable.sort-active { background: var(--c-navy-dark); }

.corp-table td {
    padding: 11px 14px;
    border-top: 1px solid var(--c-border-light);
    color: var(--c-text);
    vertical-align: middle;
}
.corp-table tbody tr:nth-child(even) td { background: var(--c-row-alt); }
.corp-table tbody tr:hover td { background: var(--c-row-hover); }
.corp-table .col-num {
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: var(--c-navy);
    font-weight: 600;
}

/* ====== Pager ====== */
.pager {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border-top: 1px solid var(--c-border-light);
    background: var(--c-row-alt);
}
.pager a {
    color: var(--c-navy);
    text-decoration: none;
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    background: var(--c-surface);
    border-radius: 2px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: all 0.15s;
}
.pager a:hover {
    background: var(--c-blue);
    border-color: var(--c-blue);
    color: #fff;
    text-decoration: none;
}
.pager a.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
    background: var(--c-bg);
    color: #9ca3af;
}
.pager .pager-info {
    color: var(--c-text-muted);
    font-size: 12px;
    font-weight: 600;
    margin: 0 12px;
    letter-spacing: 0.04em;
}

/* ====== Empty state ====== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--c-text-soft);
}
.empty-state .icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    color: var(--c-blue);
    opacity: 0.6;
}
.empty-state p { margin: 4px 0; }
.empty-state .title {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 600;
    color: var(--c-navy);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ====== Footer ====== */
.site-footer {
    background: var(--c-navy);
    color: #cbd5e1;
    padding: 28px 0;
    font-size: 12px;
    margin-top: auto;
    border-top: 3px solid var(--c-blue);
}
.site-footer .container-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.site-footer a { color: #fff; font-weight: 600; }

/* ====== Loading overlay ====== */
#search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 26, 47, 0.93);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
}
#search-overlay.active { display: flex; opacity: 1; }
.loader-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    text-align: center;
    color: #fff;
}
.loader-ring {
    position: relative;
    width: 80px;
    height: 80px;
}
.loader-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.15);
    border-top-color: var(--c-blue);
    border-right-color: var(--c-blue);
    animation: corp-ring-spin 0.9s linear infinite;
}
@keyframes corp-ring-spin { to { transform: rotate(360deg); } }
.loader-title {
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fff;
}
.loader-subtitle {
    font-size: 12px;
    color: #cbd5e1;
    margin: 6px 0 0;
    letter-spacing: 0.03em;
}
.loader-bar {
    width: 220px;
    height: 2px;
    background: rgba(255,255,255,0.15);
    overflow: hidden;
    position: relative;
}
.loader-bar::after {
    content: '';
    position: absolute;
    top: 0; left: -40%;
    height: 100%;
    width: 40%;
    background: var(--c-blue);
    animation: corp-bar-sweep 1.2s ease-in-out infinite;
}
@keyframes corp-bar-sweep {
    0%   { left: -40%; }
    100% { left: 100%; }
}

/* ====== Login-specific components ====== */
.login-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 48px;
    display: flex;
    justify-content: flex-end;
    width: 100%;
}
.login-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-top: 3px solid var(--c-blue);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 440px;
}
.login-card-header {
    padding: 28px 32px 18px;
    border-bottom: 1px solid var(--c-border-light);
}
.login-card-header h2 {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 600;
    color: var(--c-navy);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 6px;
}
.login-card-header p {
    margin: 0;
    font-size: 13px;
    color: var(--c-text-muted);
}
.login-card-body { padding: 24px 32px 28px; }
.login-card-body .field-group { margin-bottom: 16px; }
.login-card-body .field-group input { padding: 11px 13px; font-size: 14px; }

.login-error {
    display: none;
    padding: 11px 14px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-left: 3px solid #dc2626;
    color: #991b1b;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    align-items: center;
    gap: 10px;
}
.login-error.visible { display: flex; }
.login-error svg { width: 16px; height: 16px; flex-shrink: 0; color: #dc2626; }

.login-success {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 18px;
    background: #ecfdf5;
    border: 1px solid #86efac;
    border-left: 3px solid #16a34a;
    color: #166534;
    font-size: 13px;
    font-weight: 600;
    gap: 10px;
}
.login-success.visible { display: flex; }
.login-success svg { width: 36px; height: 36px; flex-shrink: 0; color: #16a34a; }

.forgot-link {
    display: block;
    text-align: right;
    margin: -8px 0 4px;
    font-size: 12px;
    font-weight: 600;
}

.login-footer-info {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--c-border-light);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    font-size: 12px;
    color: var(--c-text-soft);
}
.login-footer-info .info-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.login-footer-info svg {
    width: 13px;
    height: 13px;
    color: var(--c-navy);
}

.btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: corp-ring-spin 0.6s linear infinite;
}
.btn-loading .btn-text { display: none; }
.btn-loading .btn-spinner { display: inline-block; }

/* ====== Responsive ====== */
/* ====== Tabs ====== */
.tab-nav {
    display: flex;
    gap: 2px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--c-border);
}
.tab-nav .tab-btn {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 12px 22px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-soft);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.tab-nav .tab-btn:hover {
    color: var(--c-navy);
    background: var(--c-row-alt);
}
.tab-nav .tab-btn.active {
    color: var(--c-navy);
    border-bottom-color: var(--c-blue);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ====== Expandable order rows (drop-down documents) ====== */
.corp-table tr.order-row { cursor: pointer; }
.corp-table tr.order-row:hover td { background: var(--c-row-hover); }
.corp-table tr.order-row.expanded td { background: #eef2f7; }
.corp-table td.expand-cell {
    width: 32px;
    text-align: center;
    color: var(--c-blue);
}
.expand-caret {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 12px;
    color: var(--c-blue);
}
.order-row.expanded .expand-caret { transform: rotate(90deg); }

.corp-table tr.docs-row > td {
    padding: 0;
    background: #f5f7fa;
    border-top: none;
}
.docs-drawer {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.28s ease;
}
.docs-row.open .docs-drawer { max-height: 600px; }
.docs-inner {
    padding: 16px 20px 20px;
    border-left: 3px solid var(--c-blue);
    background: #f5f7fa;
}
.docs-inner-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-navy);
    margin: 0 0 12px;
}

/* Documents sub-table (inside a drawer) */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--c-surface);
    border: 1px solid var(--c-border-light);
}
.docs-table th {
    background: var(--c-row-alt);
    color: var(--c-navy);
    text-align: left;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid var(--c-border-light);
}
.docs-table td {
    padding: 8px 12px;
    border-top: 1px solid var(--c-border-light);
    color: var(--c-text);
    vertical-align: middle;
}
.docs-table tbody tr:hover td { background: var(--c-row-hover); }
.docs-table .doc-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--c-navy);
}
.docs-table .doc-icon { width: 16px; height: 16px; color: var(--c-blue); flex-shrink: 0; }
.docs-table .doc-meta { color: var(--c-text-soft); font-size: 12px; white-space: nowrap; }

.docs-empty {
    padding: 18px;
    text-align: center;
    color: var(--c-text-soft);
    font-size: 13px;
    background: var(--c-surface);
    border: 1px solid var(--c-border-light);
}
.docs-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px;
    color: var(--c-text-muted);
    font-size: 13px;
    font-weight: 600;
}
.docs-loading .docs-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(10,26,47,0.2);
    border-top-color: var(--c-blue);
    border-radius: 50%;
    animation: corp-ring-spin 0.7s linear infinite;
    flex-shrink: 0;
}

/* ====== Responsive ====== */
@media (max-width: 720px) {
    .utility-bar .container-inner { font-size: 11px; }
    .page-banner h1 { font-size: 30px; }
    .corp-table th, .corp-table td { padding: 9px 10px; font-size: 12px; }
    .corp-table th.sortable { padding-right: 22px; }
    .login-card-header, .login-card-body { padding-left: 22px; padding-right: 22px; }
    .login-wrap { justify-content: center; padding: 20px 16px 32px; }
    .tab-nav .tab-btn { padding: 10px 14px; font-size: 12px; }
}
