/*
 * Dashboard theme.
 *
 * Bootstrap 5 provides the grid, forms, and utilities. This file supplies the Horse Trailer
 * World palette and the handful of components the mockup uses that Bootstrap has no direct
 * equivalent for: the brand bar, the side navigation, stat tiles, and status badges.
 */

:root {
    --htw-red: #a32d2d;
    --htw-red-dark: #7e2222;
    --htw-ink: #1f1f1d;
    --htw-ink-soft: #5f5e5a;
    --htw-ink-muted: #8a8a85;
    --htw-line: #e4e2db;
    --htw-bg: #f4f3ee;
    --htw-card: #ffffff;
    --htw-success-bg: #eaf3de;
    --htw-success-text: #3b6d11;
    --htw-warning-bg: #faeeda;
    --htw-warning-text: #854f0b;
    --htw-radius: 8px;

    /* Point Bootstrap's theme colour at the brand red so links and focus rings match. */
    --bs-primary: #a32d2d;
    --bs-primary-rgb: 163, 45, 45;
    --bs-link-color: #a32d2d;
    --bs-link-color-rgb: 163, 45, 45;
    --bs-link-hover-color: #7e2222;
    --bs-body-bg: #f4f3ee;
    --bs-body-color: #1f1f1d;
    --bs-border-color: #e4e2db;
    --bs-border-radius: 8px;
}

body {
    background: var(--htw-bg);
    color: var(--htw-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* Bootstrap compiles .btn-primary colours from Sass rather than the --bs-primary variable,
   so the brand red has to be restated through the button's own custom properties. */
.btn-primary {
    --bs-btn-bg: var(--htw-red);
    --bs-btn-border-color: var(--htw-red);
    --bs-btn-hover-bg: var(--htw-red-dark);
    --bs-btn-hover-border-color: var(--htw-red-dark);
    --bs-btn-active-bg: var(--htw-red-dark);
    --bs-btn-active-border-color: var(--htw-red-dark);
    --bs-btn-disabled-bg: var(--htw-red);
    --bs-btn-disabled-border-color: var(--htw-red);
}

.btn-danger-soft {
    --bs-btn-color: var(--htw-red);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #e3b3af;
    --bs-btn-hover-color: var(--htw-red);
    --bs-btn-hover-bg: #fbeceb;
    --bs-btn-hover-border-color: #c9463f;
    --bs-btn-disabled-color: var(--htw-red);
    --bs-btn-disabled-bg: #fff;
    --bs-btn-disabled-border-color: #e3b3af;
}

/* Top brand strip, matching the main site header. */
.brandbar {
    background: #fff;
    padding: 22px 0 14px;
    text-align: center;
    border-bottom: 1px solid var(--htw-line);
}

.brandbar .brand-logo {
    width: 220px;
    max-width: 100%;
    height: auto;
}

.accountbar {
    background: var(--htw-red);
    color: #fff;
    font-size: 13px;
}

.accountbar a,
.accountbar-link {
    color: #fff;
    opacity: .92;
    text-decoration: none;
}

.accountbar-link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.accountbar a:hover,
.accountbar-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Side navigation. */
.sidenav {
    background: #fff;
    border-right: 1px solid var(--htw-line);
    padding: 18px 0;
    min-height: calc(100vh - 130px);
}

.sidenav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--htw-ink-soft);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidenav a:hover {
    color: var(--htw-red);
    background: #faf7f2;
}

.sidenav a.active {
    color: var(--htw-red);
    border-left-color: var(--htw-red);
    background: #faf2f0;
}

.sidenav .icon {
    width: 16px;
    text-align: center;
    font-size: 13px;
}

.sidenav .divider {
    height: 1px;
    background: var(--htw-line);
    margin: 12px 20px;
}

.sidenav .version {
    padding: 14px 20px 4px;
    font-size: 10.5px;
    color: var(--htw-ink-muted);
}

.dashboard-main {
    padding: 24px 28px 60px;
    min-width: 0;
}

/* Page heading block. */
.page-heading h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.page-heading .sub {
    font-size: 13px;
    color: var(--htw-ink-soft);
    margin-top: 4px;
}

/* Cards and panels. */
.panel-card {
    background: var(--htw-card);
    border: 1px solid var(--htw-line);
    border-radius: var(--htw-radius);
    padding: 14px 16px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
}

.panel-title {
    font-size: 14px;
    font-weight: 700;
}

.panel-note {
    font-size: 11px;
    color: var(--htw-ink-muted);
}

/* Stat tiles. */
.stat {
    background: var(--htw-card);
    border: 1px solid var(--htw-line);
    border-radius: var(--htw-radius);
    padding: 14px 16px;
    height: 100%;
}

.stat .label {
    font-size: 12px;
    color: var(--htw-ink-soft);
}

.stat .value {
    font-size: 22px;
    font-weight: 700;
    margin-top: 4px;
}

.stat-condensed {
    padding: 9px 12px;
}

.stat-condensed .label {
    font-size: 11px;
}

.stat-condensed .value {
    font-size: 17px;
    margin-top: 2px;
}

/* Quick action tiles on the dealer summary. */
.qa-tile {
    display: block;
    background: var(--htw-card);
    border: 1px solid var(--htw-line);
    border-radius: var(--htw-radius);
    padding: 12px 10px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.qa-tile:hover {
    border-color: var(--htw-red);
    color: inherit;
}

.qa-tile .qa-icon {
    font-size: 18px;
    margin-bottom: 6px;
}

.qa-tile .qa-title {
    font-size: 12px;
    font-weight: 700;
}

.qa-tile .qa-sub {
    font-size: 10.5px;
    color: var(--htw-ink-muted);
    margin-top: 2px;
}

/* Tables. */
.table-wrap {
    border: 1px solid var(--htw-line);
    border-radius: var(--htw-radius);
    overflow: hidden;
}

.table-wrap .table {
    margin-bottom: 0;
    font-size: 13px;
    background: var(--htw-card);
}

.table-wrap .table > thead th {
    background: #faf9f6;
    font-weight: 600;
    color: var(--htw-ink-soft);
    padding: 9px 12px;
    border-bottom: 1px solid var(--htw-line);
    white-space: nowrap;
}

.table-wrap .table > tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--htw-line);
    vertical-align: middle;
}

.table-wrap .table > tbody tr:hover td {
    background: #faf5f2;
}

.table-note {
    font-size: 12px;
    color: var(--htw-ink-muted);
    margin-top: 8px;
}

/* Status badges. */
.badge-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 5px;
    display: inline-block;
}

.badge-status-active {
    background: var(--htw-success-bg);
    color: var(--htw-success-text);
}

.badge-status-draft {
    background: var(--htw-warning-bg);
    color: var(--htw-warning-text);
}

.badge-status-sold,
.badge-status-archived {
    background: #eceae3;
    color: var(--htw-ink-muted);
}

/* Status and category filter tabs. */
.cat-tab {
    display: inline-block;
    border: 2px solid var(--htw-red);
    background: #fff;
    color: var(--htw-red);
    font-weight: 700;
    font-size: 13px;
    padding: 9px 18px;
    border-radius: 6px;
    text-decoration: none;
}

.cat-tab:hover {
    color: var(--htw-red);
}

.cat-tab.active {
    background: var(--htw-red);
    color: #fff;
}

/* Bulk action bar above the inventory grid. */
.bulk-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #faf9f6;
    border: 1px solid var(--htw-line);
    border-radius: var(--htw-radius);
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--htw-ink-soft);
}

/* Empty-state panels. */
.locked-panel {
    background: var(--htw-card);
    border: 1px dashed #c9c7bd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
}

.locked-panel .locked-icon {
    font-size: 26px;
    margin-bottom: 8px;
}

.locked-panel .locked-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
}

.locked-panel .locked-sub {
    font-size: 13px;
    color: var(--htw-ink-soft);
    margin: 0;
}

/* Marks a panel that is deliberately not built yet. */
.dev-note {
    background: #fdf6e3;
    border: 1.5px dashed #d9b64e;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 12.5px;
    color: #6b5610;
    line-height: 1.5;
}

/* Performance overview grid on the dealer summary. */
.perf-item .n {
    font-size: 17px;
    font-weight: 700;
}

.perf-item .l {
    font-size: 11px;
    color: var(--htw-ink-soft);
}

/* Logon page. */
.logon-card {
    max-width: 420px;
    margin: 48px auto;
}
