/* Record Book Manager — styles */

.rbm-wrapper {
	max-width: 960px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #222;
}

.rbm-editor { max-width: 1040px; }

.rbm-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.rbm-title {
	margin: 0 0 4px;
	font-size: 24px;
	color: #1F3864;
}

.rbm-muted {
	margin: 0;
	color: #666;
	font-size: 14px;
}

.rbm-muted a { color: #1F3864; }

/* --------------------------------------------------------------
 * Form general
 * -------------------------------------------------------------- */

.rbm-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.rbm-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rbm-field label {
	font-weight: 600;
	font-size: 14px;
	color: #444;
}

.rbm-field input[type="text"],
.rbm-field input[type="email"],
.rbm-field input[type="password"],
.rbm-field select,
.rbm-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #c5c5c5;
	border-radius: 6px;
	font-size: 15px;
	font-family: inherit;
	background: #fff;
	box-sizing: border-box;
}

.rbm-field input:focus,
.rbm-field select:focus,
.rbm-field textarea:focus {
	outline: none;
	border-color: #1F3864;
	box-shadow: 0 0 0 3px rgba( 31, 56, 100, 0.15 );
}

.rbm-field textarea {
	resize: vertical;
	min-height: 100px;
	line-height: 1.5;
}

.rbm-story-body { min-height: 400px; }

/* TinyMCE rich editor — align with the rest of the form */
.rbm-wrapper .wp-editor-wrap {
	border: 1px solid #c5c5c5;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
}
.rbm-wrapper .wp-editor-container { border: 0; }
.rbm-wrapper .mce-toolbar-grp,
.rbm-wrapper .mce-edit-area {
	border: 0 !important;
}
.rbm-wrapper .mce-panel { background: #f8f8f8; }
.rbm-wrapper .wp-editor-tabs { display: none; }

.rbm-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media ( max-width: 640px ) {
	.rbm-grid-2 { grid-template-columns: 1fr; }
}

.rbm-fieldset {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fff;
	padding: 18px 20px;
	margin: 0;
}

.rbm-fieldset legend {
	padding: 0 8px;
	font-weight: 600;
	color: #1F3864;
	font-size: 15px;
}

.rbm-fieldset > .rbm-field,
.rbm-fieldset > .rbm-grid-2,
.rbm-fieldset > p,
.rbm-fieldset > textarea,
.rbm-fieldset > table {
	margin-top: 12px;
}

.rbm-fieldset textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #c5c5c5;
	border-radius: 6px;
	font-size: 15px;
	font-family: inherit;
	box-sizing: border-box;
}

/* --------------------------------------------------------------
 * Tables (Sections 4 / 5)
 * -------------------------------------------------------------- */

.rbm-data-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 10px;
}

.rbm-data-table th,
.rbm-data-table td {
	border: 1px solid #e0e0e0;
	padding: 6px 8px;
	text-align: left;
	vertical-align: top;
	font-size: 14px;
}

.rbm-data-table th {
	background: #f5f6f8;
	font-weight: 600;
	color: #1F3864;
}

.rbm-data-table input[type="text"] {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid transparent;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
	background: transparent;
	box-sizing: border-box;
}
.rbm-data-table input[type="text"]:focus {
	outline: none;
	border-color: #1F3864;
	background: #fff;
	box-shadow: 0 0 0 2px rgba( 31, 56, 100, 0.15 );
}

/* --------------------------------------------------------------
 * Buttons
 * -------------------------------------------------------------- */

.rbm-btn {
	padding: 10px 18px;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	border: none;
	font-family: inherit;
	text-decoration: none;
	display: inline-block;
	transition: opacity 0.15s, background 0.15s;
}

.rbm-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.rbm-btn-primary        { background: #1F3864; color: #fff; }
.rbm-btn-primary:hover:not(:disabled)   { background: #162949; color: #fff; }

.rbm-btn-secondary      { background: #fff; color: #1F3864; border: 1px solid #1F3864; }
.rbm-btn-secondary:hover:not(:disabled) { background: #f0f3f9; }

.rbm-btn-ghost          { background: transparent; color: #555; border: 1px solid #ccc; }
.rbm-btn-ghost:hover:not(:disabled)     { background: #f6f6f6; }

.rbm-btn-danger         { background: #fff; color: #a3121d; border: 1px solid #d9a0a5; }
.rbm-btn-danger:hover:not(:disabled)    { background: #fce8ea; }

.rbm-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 8px;
}

.rbm-sticky-actions {
	position: sticky;
	bottom: 0;
	background: rgba( 255, 255, 255, 0.97 );
	padding: 12px 0;
	border-top: 1px solid #eee;
	margin-top: 24px;
	z-index: 5;
}

.rbm-help {
	font-size: 13px;
	color: #666;
	margin: 0;
}

.rbm-help a { color: #1F3864; }

.rbm-inline-check {
	display: flex;
	gap: 8px;
	align-items: center;
	font-size: 13px;
	color: #555;
	margin-top: 6px;
	font-weight: normal;
}

.rbm-counter-line {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	align-items: center;
}

.rbm-word-count,
.rbm-page-count {
	font-variant-numeric: tabular-nums;
}

.rbm-page-count {
	font-weight: 600;
	color: #1F3864;
}

.rbm-page-count.rbm-near-limit {
	color: #A56200;
}

.rbm-page-count.rbm-over-limit {
	color: #B22234;
}

/* --------------------------------------------------------------
 * Status messages
 * -------------------------------------------------------------- */

.rbm-status {
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 14px;
	min-height: 20px;
	display: none;
	margin-top: 8px;
}

.rbm-status:not(:empty) { display: block; }

.rbm-status-working { background: #fff8e1; color: #8a6d00; border: 1px solid #f3e2a6; }
.rbm-status-ok      { background: #e7f6ec; color: #1f6f3a; border: 1px solid #b7e0c3; }
.rbm-status-error   { background: #fce8ea; color: #a3121d; border: 1px solid #f0b8bd; }

/* --------------------------------------------------------------
 * Login / Register tabs
 * -------------------------------------------------------------- */

.rbm-auth-tabs {
	display: flex;
	gap: 0;
	border-bottom: 1px solid #ddd;
	margin-bottom: 20px;
}

.rbm-tab {
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	padding: 10px 18px;
	font-size: 15px;
	font-weight: 500;
	color: #666;
	cursor: pointer;
	font-family: inherit;
	margin-bottom: -1px;
}

.rbm-tab:hover { color: #1F3864; }

.rbm-tab-active {
	color: #1F3864;
	border-bottom-color: #1F3864;
}

.rbm-tab-pane { display: none; }
.rbm-tab-pane-active { display: flex; }

/* --------------------------------------------------------------
 * Dashboard — "new document" buttons + reference card
 * -------------------------------------------------------------- */

.rbm-new-buttons {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.rbm-reference-card {
	background: #f5f9ff;
	border: 1px solid #cfdcef;
	border-radius: 8px;
	padding: 16px 20px;
	margin-bottom: 24px;
}

.rbm-reference-card h3 {
	margin: 0 0 4px;
	color: #1F3864;
	font-size: 17px;
}

.rbm-quick-tips {
	margin: 10px 0 0;
	padding-left: 20px;
	font-size: 14px;
	color: #333;
}
.rbm-quick-tips li { margin-bottom: 4px; }

.rbm-empty {
	text-align: center;
	padding: 48px 20px;
	background: #fafafa;
	border: 1px dashed #ddd;
	border-radius: 8px;
}
.rbm-empty p { margin: 0 0 16px; color: #666; }

.rbm-doc-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.rbm-doc-card {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 16px 18px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	flex-wrap: wrap;
}

.rbm-doc-info { flex: 1 1 260px; min-width: 0; }
.rbm-doc-title {
	margin: 4px 0;
	font-size: 17px;
	color: #1F3864;
	word-break: break-word;
}

.rbm-doc-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 2px 8px;
	border-radius: 999px;
	margin-bottom: 4px;
}
.rbm-badge-story        { background: #eef4ff; color: #1F3864; }
.rbm-badge-report_form  { background: #fff1e0; color: #8a4500; }
.rbm-badge-photo_pages  { background: #e7f6ec; color: #1f6f3a; }

.rbm-doc-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.rbm-doc-actions .rbm-btn {
	padding: 7px 14px;
	font-size: 14px;
}

/* --------------------------------------------------------------
 * Editor callout (per-type guidance)
 * -------------------------------------------------------------- */

.rbm-callout {
	background: #fff8e1;
	border: 1px solid #f3e2a6;
	border-radius: 8px;
	padding: 14px 18px;
	margin-bottom: 20px;
}

.rbm-callout h3 {
	margin: 0 0 8px;
	font-size: 15px;
	color: #8a6d00;
}

.rbm-callout ul {
	margin: 0 0 8px;
	padding-left: 20px;
	font-size: 14px;
	color: #2a2a2a;
}
.rbm-callout li { margin-bottom: 4px; line-height: 1.4; }

/* --------------------------------------------------------------
 * Editor — photo entries
 * -------------------------------------------------------------- */

.rbm-entries {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.rbm-entry {
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fafafa;
	padding: 14px;
}

.rbm-entry-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.rbm-entry-num {
	font-weight: 600;
	color: #1F3864;
	font-size: 14px;
}

.rbm-remove {
	background: transparent;
	border: none;
	font-size: 22px;
	line-height: 1;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	cursor: pointer;
	color: #888;
	transition: all 0.15s;
}
.rbm-remove:hover {
	background: #eee;
	color: #c0111c;
}

.rbm-entry-body {
	display: grid;
	grid-template-columns: 220px 1fr;
	gap: 16px;
	align-items: start;
}

@media ( max-width: 560px ) {
	.rbm-entry-body { grid-template-columns: 1fr; }
}

.rbm-field-photo input[type="file"] {
	width: 100%;
	font-size: 13px;
}

.rbm-preview {
	margin-top: 8px;
	min-height: 40px;
	border-radius: 4px;
}
.rbm-preview img {
	max-width: 100%;
	max-height: 200px;
	display: block;
	border-radius: 4px;
	border: 1px solid #ddd;
}
.rbm-preview-error {
	color: #c0111c;
	font-size: 13px;
	padding: 6px 0;
}

.rbm-upload-status {
	font-size: 13px;
	margin-top: 6px;
	min-height: 18px;
}
.rbm-upload-working { color: #8a6d00; }
.rbm-upload-ok      { color: #1f6f3a; }
.rbm-upload-error   { color: #a3121d; }
