/* Minimal custom styles for APS CRM */
.flash-container { margin-bottom: 1rem; }
.card-header { font-weight: 600; }

/* Orders table note wrapping */
.orders-table .note-col { max-width: 280px; width: 24vw; }
.orders-table .note-text {
	white-space: normal;
	word-break: break-word;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

/* Amount column: no wrap and right align */
.orders-table td:nth-child(5) { white-space: nowrap; text-align: right; }

/* Created column: no wrap */
.orders-table td:nth-child(8) { white-space: nowrap; }

/* Status column: ensure enough width */
.orders-table td:nth-child(6) { min-width: 140px; }
.orders-table td:nth-child(6) .form-select { min-width: 140px; width: 100%; }

/* Due date column (Срок): no wrap and reasonable width */
.orders-table td:nth-child(7) { white-space: nowrap; min-width: 110px; }

/* Actions: 3 in a row grid */
.orders-table td.actions { width: 180px; }
.orders-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; align-items: stretch; }
.orders-actions form { margin: 0; }
.orders-actions .btn { width: 100%; }

/* Compact note textarea in order form */
.small-note { min-height: 28px; line-height: 1.2; padding-top: .25rem; padding-bottom: .25rem; }

/* Sidebar behavior on small screens */
.sidebar { min-height: auto; }
@media (min-width: 768px) { .sidebar { min-height: 100vh; } }

/* Theme: change primary color to #FF5800 */
:root {
	--bs-primary: #FF5800;
	--bs-primary-rgb: 255, 88, 0;
	--bs-link-color: #FF5800;
	--bs-link-hover-color: #e04f00;
}

.btn-primary {
	--bs-btn-color: #fff;
	--bs-btn-bg: #FF5800;
	--bs-btn-border-color: #FF5800;
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: #e04f00;
	--bs-btn-hover-border-color: #d64c00;
	--bs-btn-focus-shadow-rgb: 255, 88, 0;
	--bs-btn-active-color: #fff;
	--bs-btn-active-bg: #cc4800;
	--bs-btn-active-border-color: #c24400;
	--bs-btn-disabled-bg: #FF5800;
	--bs-btn-disabled-border-color: #FF5800;
}

.btn-outline-primary {
	--bs-btn-color: #FF5800;
	--bs-btn-border-color: #FF5800;
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: #FF5800;
	--bs-btn-hover-border-color: #FF5800;
	--bs-btn-active-color: #fff;
	--bs-btn-active-bg: #e04f00;
	--bs-btn-active-border-color: #e04f00;
	--bs-btn-disabled-color: #FF5800;
	--bs-btn-disabled-border-color: #FF5800;
}

.nav-pills .nav-link.active, .nav-pills .show>.nav-link { background-color: #FF5800; }
.form-check-input:checked { background-color: #FF5800; border-color: #FF5800; }
.badge.bg-primary { background-color: #FF5800 !important; }
a, .link-primary { color: #FF5800; }
a:hover, .link-primary:hover { color: #e04f00; }

/* Mobile tweaks */
@media (max-width: 767.98px) {
	/* Stack header buttons */
	.d-flex.gap-2 { flex-wrap: wrap; }

	/* Sidebar turns into block above content */
	.sidebar { margin-bottom: 1rem; }

	/* Actions: 2 per row on mobile */
	.orders-actions { grid-template-columns: repeat(2, 1fr); }

	/* Note column wider on mobile */
	.orders-table .note-col { max-width: none; width: auto; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
	/* Tablet: slightly reduce note col width, keep actions grid */
	.orders-table .note-col { max-width: 220px; width: 20vw; }
	.orders-actions { grid-template-columns: repeat(3, 1fr); }
}
