:root {
    --maroon: #6d0722;
    --maroon-dark: #510618;
    --beige: #bcb4a8;
    --panel-bg: #ebe8e3;
    --content-bg: #f4f4f4;
    --page-strip: #d7d1c9;
    --text: #4f4f4f;
    --border: #b8b0a5;
    --danger: #b91414;
    --success: #19672b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: Arial, Helvetica, sans-serif;
    background: #d6d2cc;
    color: var(--text);
}
a { color: #6d0722; }
.site-wrap {
    width: 760px;
    max-width: 100%;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 0 1px rgba(0,0,0,.04);
}
.topbar {
    background: var(--maroon);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 14px;
}
.brand {
    font-weight: 800;
    font-size: 34px;
    line-height: 1;
    letter-spacing: 1px;
}
.top-search-inline form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.top-search-inline input,
.top-search-inline button {
    height: 31px;
    border: 1px solid #c9c9c9;
    padding: 4px 8px;
    font-size: 12px;
}
.top-search-inline input { width: 145px; }
.top-search-inline button,
button,
.button {
    background: linear-gradient(#a0a0a0, #777);
    color: white;
    border: 1px solid #666;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}
button,
.button {
    padding: 10px 16px;
    font-size: 14px;
    display: inline-block;
}
button[disabled],
.top-search-inline button[disabled] {
    opacity: .55;
    cursor: not-allowed;
}
.layout {
    display: flex;
    min-height: calc(100vh - 92px);
}
.sidebar {
    width: 187px;
    background: var(--beige);
    padding: 10px 10px 18px;
}
.sidebar h2 {
    margin: 0 0 8px;
    color: var(--maroon);
    font-size: 14px;
    line-height: 1.1;
    letter-spacing: .4px;
}
.sidebar nav a,
.side-links a {
    display: block;
    text-decoration: none;
    margin: 10px 0;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}
.sidebar nav a.active,
.sidebar nav a:hover { color: var(--maroon); }
.side-links { margin-top: 18px; }
.side-links a { color: #5f584f; }
.content {
    flex: 1;
    background: var(--content-bg);
    padding-bottom: 18px;
}
.page-title {
    margin: 0;
    padding: 10px 12px 12px;
    background: var(--page-strip);
    color: #5d5d63;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.05;
    text-transform: uppercase;
}
.panel {
    margin: 14px 8px;
    padding: 12px 14px;
    background: var(--panel-bg);
    border: 1px solid var(--border);
}
.panel h3 {
    margin: 0 0 10px;
    color: #55555c;
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
}
.panel p,
.panel li,
.table td,
.table th,
.notice,
.search-tip,
.download-password,
.form-help {
    font-size: 14px;
    line-height: 1.5;
}
.search-form { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.input-wrap { flex: 1 1 420px; }
.search-form input[type=text],
.search-form input[type=password],
.search-form input[type=email],
.search-form input[type=file] {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #9d9d9d;
    background: white;
    font-size: 14px;
}
.search-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: start;
}
.muted, .form-help { color: #777; }
.error, .success { font-weight: 700; margin-top: 6px; }
.error { color: var(--danger); }
.success { color: var(--success); }
.notice {
    background: #fff7d8;
    border: 1px solid #ddd094;
    padding: 10px 12px;
    margin: 12px 8px;
}
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}
.table th, .table td {
    border: 1px solid #ccc;
    padding: 8px 9px;
    text-align: left;
    vertical-align: top;
}
.table th {
    background: #ececec;
    font-weight: 700;
}
.admin-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 12px 8px 0;
}
.tag {
    display: inline-block;
    background: #ececec;
    border: 1px solid #d4d4d4;
    padding: 4px 8px;
    margin-right: 6px;
    font-size: 12px;
}
.download-password {
    margin-top: 12px;
    font-weight: 700;
}
.download-password .value {
    color: var(--danger);
    font-weight: 800;
}
.summary-list {
    margin: 0;
    padding-left: 18px;
}
.link-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.link-list li {
    padding: 12px 0;
    border-top: 1px solid #d4ccc1;
}
.link-list li:first-child { border-top: none; padding-top: 0; }
.back-top {
    margin-top: 8px;
    font-size: 12px;
}
.dashboard-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.meta-box {
    background: #fff;
    border: 1px solid #ccc;
    padding: 10px;
}
.footer {
    background: var(--maroon);
    color: white;
    padding: 10px 12px;
    font-size: 12px;
}
@media (max-width: 760px) {
    .topbar, .layout { display: block; }
    .top-search-inline { margin-top: 12px; }
    .top-search-inline input { width: 100%; }
    .top-search-inline form { flex-wrap: wrap; }
    .sidebar { width: auto; }
    .dashboard-meta { grid-template-columns: 1fr; }
    .search-grid { grid-template-columns: 1fr; }
}

/* Header search message color fix */
.top-search-inline #headerSearchMessage {
    color: #ffffff !important;
}

.top-search-inline .success {
    color: #ffffff !important;
}

.top-search-inline .error {
    color: #ffffff !important;
}

.top-search-inline .form-help {
    color: #ffffff !important;
}
/* FIX: prevent header search layout shift */
.top-search-inline {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Reserve fixed space for message */
#headerSearchMessage {
    height: 18px;           /* fixed height */
    line-height: 18px;
    margin-top: 4px;
    font-size: 12px;
    color: #ffffff;
    white-space: nowrap;    /* prevent line break */
    overflow: hidden;
}

#headerSearchMessage {
    transition: opacity 0.2s ease;
}

.summary-list {
    margin: 8px 0 16px 18px;
    padding: 0;
}
.summary-list li {
    margin-bottom: 8px;
}

.contact-grid {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.contact-col {
    width: 50%;
}

.contact-box {
    margin-bottom: 20px;
    font-size: 12px;
    line-height: 1.45;
}

.contact-box strong {
    color: #7d1530;
    display: inline-block;
    margin-bottom: 4px;
}
.link-item {
    margin-bottom: 18px;
    line-height: 1.5;
    font-size: 13px;
}

.link-item strong {
    color: #7d1530;
}

.link-item span {
    color: #555;
}
.panel h3 {
    margin-bottom: 10px;
    color: #333;
}

.panel a {
    color: #7d1530;
    text-decoration: underline;
}

.panel a:hover {
    text-decoration: none;
}
.page-title {
    font-size: 22px;
    margin-bottom: 10px;
}

.panel h2 {
    font-size: 18px;
    margin-bottom: 10px;
}

.content-box {
    border: 1px solid #c9c1b8;
    background: #f3f0eb;
    padding: 18px;
    line-height: 1.6;
    font-size: 13px;
}

.content-box h3,
.content-box h4 {
    margin-top: 18px;
    color: #333;
}

.content-box a {
    color: #7d1530;
    text-decoration: underline;
}

.content-box a:hover {
    text-decoration: none;
}

.content-box ul {
    margin-left: 20px;
}

.back-top {
    font-size: 12px;
    color: #7d1530;
    margin: 10px 0;
    cursor: pointer;
}
.content-box {
    border: 1px solid #c9c1b8;
    background: #f3f0eb;
    padding: 18px;
    line-height: 1.6;
    font-size: 13px;
}

.content-box h4 {
    margin-top: 18px;
    color: #333;
}

.content-box a {
    color: #7d1530;
    text-decoration: underline;
}

.content-box a:hover {
    text-decoration: none;
}

.content-box ul {
    margin-left: 20px;
}

.back-top {
    font-size: 12px;
    color: #7d1530;
    margin: 10px 0;
}
