:root {
	--navy: #0b1f3a;
	--navy-light: #16325c;
	--accent: #0066cc;
	--accent-hover: #0052a3;
	--surface: #f4f7fb;
	--muted: #5c6b7a;
	--border: #d8e0ea;
	--white: #fff;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: var(--surface);
	color: var(--navy);
	line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.sec-field { text-align: left; margin-bottom: 1rem; }
.sec-field label {
	display: block;
	font-size: 0.8125rem;
	font-weight: 600;
	margin-bottom: 0.375rem;
}
.sec-field input {
	width: 100%;
	padding: 0.75rem 0.875rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-size: 1rem;
}
.sec-field input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.sec-btn {
	display: inline-block;
	width: 100%;
	padding: 0.875rem;
	background: var(--accent);
	color: var(--white);
	border: none;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
}
.sec-btn:hover { background: var(--accent-hover); }

.sec-error {
	background: #fdecea;
	border: 1px solid #f5c2c0;
	color: #b42318;
	padding: 0.75rem;
	border-radius: 8px;
	font-size: 0.875rem;
	margin-bottom: 1rem;
	text-align: left;
	display: none;
}

.sec-header {
	background: var(--white);
	border-bottom: 1px solid var(--border);
	padding: 0.875rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
}

.sec-header img { height: 40px; }
.sec-nav { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.sec-nav a { color: var(--navy); font-weight: 500; font-size: 0.9rem; }
.sec-nav button {
	background: none;
	border: none;
	color: var(--muted);
	cursor: pointer;
	font-size: 0.9rem;
}

.sec-main { max-width: 1700px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

.sec-hero {
	background: linear-gradient(160deg, var(--navy) 0%, var(--navy-light) 100%);
	color: var(--white);
	padding: 2.5rem 1.5rem;
	border-radius: 12px;
	margin-bottom: 2rem;
	text-align: center;
}
.sec-hero h1 { margin: 0 0 0.5rem; font-size: 1.75rem; }
.sec-hero p { margin: 0; opacity: 0.9; }

.sec-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 1.5rem;
}

.sec-user-label {
	font-size: 0.875rem;
	color: var(--navy);
	font-weight: 600;
}

.sec-user-bar {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.sec-settings-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 8px;
	color: var(--muted);
	transition: background 0.15s, color 0.15s;
}

.sec-settings-btn:hover {
	background: #eef3f9;
	color: var(--accent);
}

/* Language switcher in header */
.sec-lang-switch {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin-left: 0.5rem;
	margin-right: 0.25rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 1px;
	background: #f8fafc;
}

.sec-lang-btn {
	font-size: 0.7rem;
	line-height: 1;
	padding: 0.2rem 0.45rem;
	border: 0;
	background: transparent;
	color: var(--muted);
	border-radius: 999px;
	cursor: pointer;
	font-weight: 600;
}

.sec-lang-btn.active {
	background: var(--navy);
	color: #fff;
}

.sec-lang-btn:hover:not(.active) {
	background: #e8eef5;
	color: var(--navy);
}

.sec-settings-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.25rem;
	max-width: 900px;
	margin-bottom: 2rem;
}

.sec-settings-tile {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100px;
	padding: 1.25rem;
	background: var(--white);
	border: 1px solid var(--border);
	border-radius: 12px;
	font-weight: 600;
	font-size: 1rem;
	color: var(--navy);
	text-align: center;
	box-shadow: 0 4px 16px rgba(11, 31, 58, 0.06);
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.sec-settings-tile:hover {
	border-color: var(--accent);
	box-shadow: 0 8px 24px rgba(0, 102, 204, 0.12);
	transform: translateY(-2px);
	color: var(--accent);
}

@media (max-width: 520px) {
	.sec-settings-grid {
		grid-template-columns: 1fr;
	}
}

.sec-menu-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.25rem;
	max-width: 1200px;
	margin: 0 auto;
}

.sec-menu-tile {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 140px;
	padding: 1.5rem 1rem;
	background: var(--white);
	border: 1px solid var(--border);
	border-radius: 12px;
	text-align: center;
	color: var(--navy);
	font-weight: 600;
	font-size: 1.0625rem;
	box-shadow: 0 4px 16px rgba(11, 31, 58, 0.06);
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

a.sec-menu-tile:hover {
	border-color: var(--accent);
	box-shadow: 0 8px 24px rgba(0, 102, 204, 0.12);
	transform: translateY(-2px);
	color: var(--accent);
}

.sec-menu-tile__label {
	line-height: 1.35;
}

.sec-menu-tile--na {
	background: #f0f3f7;
	color: var(--muted);
	cursor: not-allowed;
	box-shadow: none;
}

.sec-page-head {
	margin-bottom: 1.5rem;
}

.sec-page-head h1 {
	margin: 0 0 0.35rem;
	font-size: 1.5rem;
}

.sec-muted {
	color: var(--muted);
	margin: 0;
}

.sec-module-body {
	background: var(--white);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 2rem;
	min-height: 120px;
	margin-bottom: 1.5rem;
}

.sec-link-back {
	font-weight: 500;
}

/* Back button placed to the right of the page title (instead of at bottom or left) */
.sec-page-head .sec-page-back {
	font-size: 1.2rem;
	line-height: 1;
	margin-left: 8px;
	vertical-align: middle;
	text-decoration: none;
	padding: 2px 4px;
	display: inline-flex;
	align-items: center;
}
.sec-page-head .sec-page-back:hover {
	text-decoration: none;
	opacity: 0.8;
}

.sec-page-head__left {
	display: flex;
	align-items: flex-start;
	gap: 6px;
}

/* Helper for title + back arrow on same line */
.sec-page-head__title-row {
	display: flex;
	align-items: center;
	gap: 6px;
}

.sec-page-head--row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.sec-btn--inline {
	width: auto;
	padding: 0.5rem 1.125rem;
	font-size: 0.875rem;
}

.sec-btn--sm {
	padding: 0.375rem 0.75rem;
	font-size: 0.8125rem;
}

.sec-btn--ghost {
	background: transparent;
	color: var(--navy);
	border: 1px solid var(--border);
}

.sec-btn--ghost:hover {
	background: #f0f3f7;
	color: var(--accent);
}

.sec-form-panel {
	background: var(--white);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 1.25rem 1.5rem;
	margin-bottom: 1.25rem;
	max-width: 550px;
}

.sec-form-panel textarea.sec-input-inline {
	width: 100%;
	font-family: inherit;
	resize: vertical;
	min-height: 60px;
}

.sec-form-panel__title {
	margin: 0 0 1rem;
	font-size: 1rem;
}

.sec-form-row {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	margin-bottom: 0.75rem;
}

.sec-form-row label {
	font-size: 0.8125rem;
	font-weight: 600;
}

.sec-form-row input,
.sec-input-inline,
.sec-select {
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-size: 0.9375rem;
	font-family: inherit;
}

.sec-form-row .sec-select {
	width: 100%;
}

.sec-input-inline {
	width: 100%;
	min-width: 120px;
}

.sec-form-hint {
	font-size: 0.8125rem;
	color: var(--muted);
	margin: 0 0 1rem;
}

.sec-form-actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.sec-message {
	padding: 0.75rem 1rem;
	border-radius: 8px;
	font-size: 0.875rem;
	margin-bottom: 1rem;
	background: #e8f4fc;
	color: var(--navy);
}

.sec-message--error {
	background: #fdecea;
	color: #b42318;
}

.sec-actions-cell {
	white-space: nowrap;
	width: 36px;
	text-align: center;
}

.sec-actions-cell .sec-btn {
	margin-right: 0.25rem;
}

@media (max-width: 720px) {
	.sec-menu-grid {
		grid-template-columns: repeat(2, 1fr);
		grid-template-rows: repeat(3, minmax(120px, 1fr));
	}
}

@media (max-width: 420px) {
	.sec-menu-grid {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
	}
}

.sec-card {
	background: var(--white);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 1.75rem;
}
.sec-card h3 { margin: 0 0 0.5rem; }
.sec-card p { color: var(--muted); font-size: 0.9375rem; margin: 0 0 1rem; }
.sec-card .sec-btn { width: auto; padding: 0.625rem 1.25rem; font-size: 0.875rem; }

.sec-table-wrap {
	background: var(--white);
	border: 1px solid var(--border);
	border-radius: 12px;
	overflow: auto;
	width: 100%;
	box-shadow: 0 1px 3px 0 rgb(15 23 42 / 0.08), 0 1px 2px -1px rgb(15 23 42 / 0.08);
}

/* Refined clean table look (inspired by stock page's nice design) */
.sec-table-wrap .sec-data-table {
	width: 100%;
	table-layout: auto;
}

.sec-table-wrap th {
	background: #f8fafc;
	font-weight: 600;
	color: #1e293b;
	border-bottom-color: #e2e8f0;
}

.sec-table-wrap td {
	border-bottom-color: #f1f5f9;
}

/* Consistent wide action column (like tuned on stock page) */
.sec-actions-col {
	width: 330px;
	text-align: left;
	white-space: nowrap;
}
.sec-actions-col .sec-btn {
	padding: 3px 6px;
	font-size: 0.8rem;
	margin: 0;
	line-height: 1;
}

/* Calendar page styles */
.calendar-grid .day-cell {
	border: 1px solid #e5e7eb;
}
.calendar-grid .schedule-badge {
	border: 1px solid #e5e7eb;
	padding: 2px 4px;
}

/* Weekend (Sat/Sun) in red - shared */
.calendar-grid .day-header.weekend,
.calendar-grid .day-cell.weekend .day-num {
	color: #dc2626;
	font-weight: 700;
}
.calendar-grid .day-cell.weekend {
	background: #fef2f2;
}

/* Today in blue - shared */
.calendar-grid .day-cell.today {
	background: #dbeafe;
	border-color: #3b82f6;
	box-shadow: inset 0 0 0 2px #3b82f6;
}
.calendar-grid .day-cell.today .day-num {
	color: #1e40af;
	font-weight: 700;
}

/* Drag range highlight - shared */
.calendar-grid .day-cell.drag-range {
	background: #fef3c7;
	border-color: #f59e0b;
}
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
	min-width: 0;
}
th, td {
	padding: 0.75rem 1rem;
	text-align: left;
	border-bottom: 1px solid var(--border);
}
th { background: #f8fafc; font-weight: 600; }
tr:last-child td { border-bottom: none; }

.sec-note {
	font-size: 0.75rem;
	color: var(--muted);
	margin-top: 1.5rem;
}

/* Customer info window below customer select in new CS record form */
.sec-customer-info {
	border: 1px solid var(--border);
	border-radius: 8px;
	background: #f8fafc;
	padding: 8px 10px;
	margin: 4px 0 8px;
	font-size: 0.8rem;
	line-height: 1.3;
}
.sec-customer-info__header {
	font-weight: 600;
	margin-bottom: 4px;
	color: var(--navy);
	font-size: 0.75rem;
}
.sec-customer-info__body {
	color: #333;
}
.sec-customer-info__body div {
	margin: 2px 0;
}

/* Display only customer name field (replaces dropdown) */
.sec-customer-display {
	background: #f0f4f8 !important;
	color: #1e293b;
	font-weight: 500;
}

/* Right sidebar for Customer DB picker */
.sec-right-sidebar {
	position: fixed;
	top: 0;
	right: 0;
	width: 380px;
	max-width: 90vw;
	height: 100vh;
	background: #fff;
	border-left: 1px solid var(--border);
	box-shadow: -6px 0 16px rgba(0, 0, 0, 0.12);
	z-index: 1050;
	display: flex;
	flex-direction: column;
	font-size: 0.875rem;
}
.sec-right-sidebar__header {
	display: flex;
	align-items: center;
	padding: 10px 12px;
	border-bottom: 1px solid var(--border);
	background: #f8fafc;
	gap: 8px;
	font-weight: 600;
}
.sec-right-sidebar__content {
	flex: 1;
	overflow: auto;
	padding: 4px 0;
}
.sec-cust-row {
	padding: 10px 14px;
	border-bottom: 1px solid #eee;
	cursor: pointer;
}
.sec-cust-row:hover {
	background: #f0f4f8;
}
.sec-cust-row .c-company {
	font-weight: 600;
}
.sec-cust-row .c-model {
	font-size: 0.75rem;
	color: #666;
	margin-left: 4px;
}
.sec-cust-row .c-meta {
	font-size: 0.75rem;
	color: #555;
	margin-top: 2px;
}

/* Layout for form + right vertical tab menu */
.cs-edit-area {
	display: flex;
	gap: 0;
	align-items: flex-start;
	position: relative;
	justify-content: center;
}
.cs-edit-area .sec-form-panel {
	flex: 1;
}

.right-rail {
	display: none;
	flex-direction: row;
	height: auto;
	min-height: 400px;
}

.cs-edit-area .sec-form-panel:not([hidden]) + .right-rail {
	display: flex;
}

.vertical-tab-bar {
	width: 60px;
	background: #f1f5f9;
	border-left: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	font-size: 11px;
	flex-shrink: 0;
}

.vtab {
	writing-mode: vertical-rl;
	text-orientation: mixed;
	padding: 10px 4px;
	text-align: center;
	cursor: pointer;
	border-bottom: 1px solid #d1d5db;
	background: #f8fafc;
	color: #334155;
	font-weight: 500;
	transition: background 0.15s;
	white-space: nowrap;
}

.vtab:hover {
	background: #e0e7ff;
}

.vtab.active {
	background: #fff;
	color: #1e40af;
	font-weight: 700;
	border-right: 3px solid #3b82f6;
}

.vtab.na {
	color: #94a3b8;
	font-style: italic;
}

.tab-content-panel {
	width: 0;
	overflow: hidden;
	transition: width 0.28s ease;
	background: #fff;
	border-left: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	box-shadow: -2px 0 8px rgba(0,0,0,0.08);
}

.tab-content-panel.open {
	width: 350px;
}

.tab-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.tab-content-header {
	padding: 8px 12px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	font-size: 0.9rem;
	display: flex;
	align-items: center;
}

.tab-list {
	flex: 1;
	overflow: auto;
	padding: 4px 8px;
}

.tab-close-btn {
	background: transparent;
	border: none;
	font-size: 1rem;
	cursor: pointer;
	line-height: 1;
	padding: 2px 6px;
}