/* Lodge Manual Registry v4 */

.lmr-wrap {
    max-width: 980px;
    margin: 0 auto;
    font-family: Georgia, 'Times New Roman', serif;
    color: #1a1a18;
}

/* ── Gate ────────────────────────────────────── */
.lmr-gate { min-height: 260px; display: flex; align-items: center; justify-content: center; }
.lmr-gate-inner { text-align: center; padding: 2.5rem; border: 1px solid #d8d6cc; border-radius: 8px; background: #f8f7f3; max-width: 380px; }
.lmr-gate-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.35rem; }
.lmr-gate-sub   { font-size: 0.875rem; color: #5a5a54; margin: 0 0 1.25rem; font-style: italic; }

/* ── Alert ───────────────────────────────────── */
.lmr-alert { background: #fdf0ee; border: 1px solid #c0533a; border-radius: 4px; color: #8b2a18; padding: 0.75rem 1rem; margin-bottom: 1.25rem; font-size: 0.875rem; }

/* ── Header ──────────────────────────────────── */
.lmr-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    border-bottom: 2px solid #1a1a18;
    padding-bottom: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.lmr-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 0.2rem; }
.lmr-sub   { font-size: 0.8rem; color: #5a5a54; margin: 0; font-style: italic; }

.lmr-admin-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-family: Arial, sans-serif;
    color: #2c3e28;
    text-decoration: none;
    border-bottom: 1px solid #2c3e28;
    transition: opacity 0.13s;
}
.lmr-admin-link:hover { opacity: 0.65; }

.lmr-admin-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-family: Arial, sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.2rem 0.55rem;
    border-radius: 3px;
    background: #2c3e28;
    color: #fff;
    vertical-align: middle;
    margin-left: 0.4rem;
    position: relative;
    top: -3px;
}

/* ── Stats ───────────────────────────────────── */
.lmr-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.lmr-stat  { text-align: right; line-height: 1.1; }
.lmr-stat-num   { display: block; font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; }
.lmr-stat-label { font-size: 0.65rem; color: #5a5a54; text-transform: uppercase; letter-spacing: 0.07em; font-family: Arial, sans-serif; }
.lmr-stat-out   .lmr-stat-num { color: #7a4010; }
.lmr-stat-avail .lmr-stat-num { color: #2c6b3e; }
.lmr-stat-never .lmr-stat-num { color: #4a4a9a; }

/* ── Admin panels (manage page only) ─────────── */
.lmr-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.75rem; }
@media (max-width: 640px) { .lmr-panels { grid-template-columns: 1fr; } }

.lmr-panel { background: #f2f0e8; border: 1px solid #d8d6cc; border-radius: 6px; padding: 1.1rem 1.25rem; }
.lmr-panel-title { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #2c3e28; margin: 0 0 0.9rem; font-family: Arial, sans-serif; }
.lmr-panel-empty { font-size: 0.85rem; color: #6a6a64; font-style: italic; margin: 0; }

.lmr-section-divider { border: none; border-top: 1px solid #e0ddd4; margin: 1.75rem 0; }

/* ── Forms ───────────────────────────────────── */
.lmr-field-row  { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.65rem; align-items: flex-end; }
.lmr-field      { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; min-width: 120px; }
.lmr-field-wide   { flex: 2; }
.lmr-field-submit { flex: 0 0 auto; min-width: auto; }
.lmr-field label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.07em; color: #4a4a44; font-family: Arial, sans-serif; }
.lmr-field em    { font-style: italic; text-transform: none; letter-spacing: 0; font-weight: 400; }
.lmr-field input,
.lmr-field select,
.lmr-date-input {
    padding: 0.4rem 0.6rem;
    border: 1px solid #c0beb4;
    border-radius: 3px;
    font-family: Georgia, serif;
    font-size: 0.875rem;
    background: #fff;
    color: #1a1a18;
    transition: border-color 0.14s;
}
.lmr-field input:focus,
.lmr-field select:focus,
.lmr-date-input:focus { outline: none; border-color: #2c3e28; box-shadow: 0 0 0 2px rgba(44,62,40,0.15); }

/* ── Buttons ─────────────────────────────────── */
.lmr-btn { display: inline-block; padding: 0.4rem 1rem; border: 1px solid #1a1a18; background: transparent; color: #1a1a18; font-family: Georgia, serif; font-size: 0.875rem; cursor: pointer; border-radius: 3px; text-decoration: none; transition: background 0.13s, color 0.13s; white-space: nowrap; }
.lmr-btn:hover   { background: #1a1a18; color: #f8f7f3; }
.lmr-btn-sm      { padding: 0.35rem 0.8rem; font-size: 0.82rem; }
.lmr-btn-primary { background: #2c3e28; border-color: #2c3e28; color: #fff; }
.lmr-btn-primary:hover { background: #1b2719; border-color: #1b2719; }
.lmr-btn-return  { background: #3a5e44; border-color: #3a5e44; color: #fff; font-size: 0.8rem; padding: 0.33rem 0.8rem; }
.lmr-btn-return:hover { background: #2c4834; border-color: #2c4834; }
.lmr-btn-text    { background: none; border: none; font-size: 0.75rem; cursor: pointer; font-family: Arial, sans-serif; padding: 0.15rem 0.4rem; border-radius: 3px; color: #4a4a44; transition: background 0.12s, color 0.12s; }
.lmr-btn-text:hover { background: #e8e6de; color: #1a1a18; }
.lmr-btn-danger  { color: #8b1a1a; }
.lmr-btn-danger:hover { background: #fde8e8; color: #6a1010; }
.lmr-btn-del     { background: none; border: none; color: #9a2a2a; font-size: 0.75rem; cursor: pointer; padding: 0.15rem 0.35rem; border-radius: 3px; font-family: Arial, sans-serif; transition: background 0.12s; }
.lmr-btn-del:hover { background: #fde8e8; }
.lmr-inline-form { display: inline; }

/* ── Toolbar ─────────────────────────────────── */
.lmr-toolbar     { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.lmr-search-form { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.lmr-search-input { padding: 0.4rem 0.65rem; border: 1px solid #c0beb4; border-radius: 3px; font-family: Georgia, serif; font-size: 0.875rem; width: 260px; max-width: 100%; color: #1a1a18; background: #fff; transition: border-color 0.14s; }
.lmr-search-input:focus { outline: none; border-color: #2c3e28; box-shadow: 0 0 0 2px rgba(44,62,40,0.15); }
.lmr-clear { font-size: 0.78rem; color: #5a5a54; text-decoration: underline; }
.lmr-filters     { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.lmr-filter-btn  { font-size: 0.72rem; padding: 0.25rem 0.65rem; border: 1px solid #c0beb4; border-radius: 20px; color: #4a4a44; text-decoration: none; font-family: Arial, sans-serif; background: transparent; transition: background 0.12s, border-color 0.12s; }
.lmr-filter-btn:hover  { border-color: #1a1a18; color: #1a1a18; }
.lmr-filter-btn.active { background: #1a1a18; border-color: #1a1a18; color: #f8f7f3; }

/* ── Cards ───────────────────────────────────── */
.lmr-registry { display: flex; flex-direction: column; gap: 0.6rem; }
.lmr-card { border: 1px solid #d8d6cc; border-radius: 6px; overflow: hidden; background: #fff; }
.lmr-card-out   { border-left: 4px solid #b06020; }
.lmr-card-avail { border-left: 4px solid #3a7a4a; }
.lmr-card-never { border-left: 4px solid #5a5aaa; }

.lmr-card-header {
    display: grid;
    grid-template-columns: auto 1fr 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
}
@media (max-width: 620px) {
    .lmr-card-header { grid-template-columns: 1fr 1fr; }
    .lmr-card-meta   { grid-column: 1 / -1; }
    .lmr-card-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.lmr-card-id-block { display: flex; flex-direction: column; gap: 0.04rem; min-width: 78px; }
.lmr-card-id       { font-family: 'Courier New', monospace; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.04em; }
.lmr-card-subtitle { font-size: 0.62rem; color: #6a6a64; font-style: italic; }

.lmr-card-status { display: flex; align-items: center; gap: 0.65rem; }
.lmr-badge { display: inline-block; font-size: 0.62rem; font-family: Arial, sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; padding: 0.18rem 0.55rem; border-radius: 20px; white-space: nowrap; }
.lmr-badge-out   { background: #fde8d0; color: #7a4010; }
.lmr-badge-avail { background: #dff2e5; color: #2c5e38; }
.lmr-badge-never { background: #eeeef8; color: #3a3a88; }

.lmr-holder-info  { display: flex; flex-direction: column; }
.lmr-holder-name  { font-size: 0.9rem; font-weight: 700; }
.lmr-holder-since { font-size: 0.68rem; color: #6a6a64; font-style: italic; }
.lmr-avail-text   { font-size: 0.75rem; color: #5a5a54; font-style: italic; }

.lmr-card-meta { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.lmr-meta-item   { font-size: 0.72rem; color: #6a6a64; font-family: Arial, sans-serif; }
.lmr-meta-italic { font-style: italic; }
.lmr-meta-sep    { color: #c0beb4; font-size: 0.72rem; }

.lmr-card-actions { display: flex; align-items: center; gap: 0.35rem; justify-content: flex-end; }

.lmr-history-toggle { background: none; border: 1px solid #c0beb4; border-radius: 20px; font-size: 0.68rem; color: #4a4a44; font-family: Arial, sans-serif; padding: 0.22rem 0.65rem; cursor: pointer; white-space: nowrap; transition: border-color 0.12s, background 0.12s, color 0.12s; }
.lmr-history-toggle:hover { border-color: #1a1a18; color: #1a1a18; }
.lmr-history-toggle.open  { background: #1a1a18; border-color: #1a1a18; color: #f8f7f3; }

/* ── Edit form (inline, manage page only) ────── */
.lmr-edit-form { border-top: 1px solid #e8e6de; background: #f8f7f3; padding: 0.75rem 1rem; }
.lmr-form-inline .lmr-field-row { margin-bottom: 0; }

/* ── Return bar (manage page only) ──────────── */
.lmr-return-bar  { border-top: 1px solid #e8e6de; background: #f8f7f3; padding: 0.55rem 1rem; }
.lmr-return-form { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.lmr-return-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: #4a4a44; font-family: Arial, sans-serif; white-space: nowrap; }

/* ── History table ───────────────────────────── */
.lmr-history     { border-top: 1px solid #e8e6de; background: #fbfaf6; padding: 0.65rem 1rem; overflow-x: auto; }
.lmr-hist-table  { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.lmr-hist-table thead { border-bottom: 1px solid #d0cec4; }
.lmr-hist-table th { text-align: left; padding: 0.28rem 0.45rem; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em; font-family: Arial, sans-serif; color: #5a5a54; font-weight: 700; }
.lmr-hist-table td { padding: 0.42rem 0.45rem; border-bottom: 1px solid #e8e6de; vertical-align: middle; }
.lmr-hist-table tbody tr:last-child td { border-bottom: none; }
.lmr-hist-active td { font-weight: 700; }
.lmr-hist-past   td { color: #5a5a54; }
.lmr-date-cell   { white-space: nowrap; font-family: Arial, sans-serif; font-size: 0.76rem; }
.lmr-duration    { color: #6a6a64; font-style: italic; font-size: 0.74rem; white-space: nowrap; }
.lmr-notes-cell  { color: #6a6a64; max-width: 200px; font-size: 0.74rem; }
.lmr-still-out   { color: #b06020; font-weight: 700; }

.lmr-empty { color: #6a6a64; font-style: italic; padding: 1rem 0; }

@media (max-width: 600px) {
    .lmr-header  { flex-direction: column; align-items: flex-start; }
    .lmr-stats   { flex-direction: row; gap: 1rem; }
    .lmr-stat    { text-align: left; }
    .lmr-toolbar { flex-direction: column; align-items: flex-start; }
    .lmr-search-input { width: 100%; }
    .lmr-field-row { flex-direction: column; }
}
