/* ============================================================
   Mytheme — White & Red Theme for Frappe Desk
   Brand: White (primary) + Red (secondary/accent)
   Same structure as the original teal/green theme —
   only the color tokens have been swapped.
   ============================================================ */

/* ----------------------------------------------------------
   1. Theme Palette & Custom Properties
   ---------------------------------------------------------- */
:root {
	/* Core red palette (brand secondary color)
	--mytheme-50: hsl(355, 100%, 93%);
	--mytheme-100: hsl(355, 100%, 86%);
	--mytheme-200: hsl(355, 100%, 72%);
	--mytheme-300: hsl(355, 100%, 58%);
	--mytheme-400: hsl(355, 100%, 44%);
	--mytheme-500: hsl(355, 100%, 33%);
	--mytheme-600: hsl(355, 100%, 30%);
	--mytheme-700: hsl(355, 100%, 26%);
	--mytheme-800: hsl(355, 100%, 21%);
	--mytheme-900: hsl(355, 100%, 15%);
	*/

	/* Core red palette (active) */
	--mytheme-50: hsl(355, 100%, 93%);
	--mytheme-100: hsl(355, 100%, 86%);
	--mytheme-200: hsl(355, 100%, 72%);
	--mytheme-300: hsl(355, 100%, 58%);
	--mytheme-400: hsl(355, 100%, 44%);
	--mytheme-500: hsl(355, 100%, 33%);
	--mytheme-600: hsl(355, 100%, 30%);
	--mytheme-700: rgb(169, 21, 31);
	--mytheme-800: hsl(355, 100%, 21%);
	--mytheme-900: hsl(355, 100%, 15%);

	/* brand red — matches Jim Investment #D91E2A / #A9151F
	--mytheme-700: rgb(169, 21, 31);
	*/

	/* Sidebar */
	/* --mytheme-sidebar-bg: #ffffff;
	--mytheme-sidebar-hover: hsl(355, 100%, 25%);
	--mytheme-sidebar-active: hsl(355, 100%, 23%);
	--mytheme-sidebar-text: hsl(355, 100%, 33%);
	--mytheme-sidebar-muted: hsl(355, 100%, 3%); */

	/* Functional */
	--mytheme-transition: 0.25s ease;
	--mytheme-radius: 8px;
	--mytheme-toggle-size: 30px;

	/* ---- Override Frappe global variables ---- */

	/* Backgrounds — clean white as primary */
	--bg-color: hsl(0, 0%, 99%);
	--fg-color: hsl(355, 100%, 97%);
	--subtle-accent: #eef1f4;
	--subtle-fg: #e8ecf0;
	--navbar-bg: #FFFFFF;
	--card-bg: hsl(210, 20%, 95%);
	--control-bg: #eef1f4;
	--control-bg-on-gray: #e2e6ea;
	--disabled-control-bg: #f0f2f5;
	--highlight-color: var(--mytheme-50);
	--fg-hover-color: var(--mytheme-50);

	/* Text — keep readable on white */
	--heading-color: #1a1f36;
	--text-color: #2d3248;
	--text-muted: #5b6178;
	--text-light: hsl(355, 100%, 15%);
	--disabled-text-color: #8a90a5;

	/* Borders — softer */
	--border-color: #dce1e8;
	--dark-border-color: #c8cdd6;
	--table-border-color: #dce1e8;

	/* Primary buttons — brand red instead of Frappe's dark gray */
	--btn-primary: var(--mytheme-600);

	/* Focus rings — red */
	--focus-default: 0 0 0 2px rgba(217, 30, 42, 0.3);

	/* Shadows — red-tinted */
	--shadow-sm: 0 1px 3px rgba(217, 30, 42, 0.06), 0 1px 2px rgba(217, 30, 42, 0.04);
	--shadow-base: 0 2px 6px rgba(217, 30, 42, 0.08);
	--card-shadow: 0 1px 4px rgba(217, 30, 42, 0.07);
}

/* ----------------------------------------------------------
   2. Navbar — Clean white with red accents
   ---------------------------------------------------------- */
.navbar {
	background: var(--navbar-bg) !important;
	border-bottom: 2px solid var(--mytheme-600);
}

.navbar .navbar-brand img,
.navbar .navbar-brand .app-logo {
	filter: none;
}

/* Navbar links — red hover (adjusted for white navbar background) */
.navbar .nav-link {
	color: var(--mytheme-900) !important;
	border-radius: 10px;
	padding: 50px;
}

.disabled a {
	color: hsl(355, 100%, 40%) !important;
}

.navbar .nav-link:hover {
	color: var(--mytheme-600) !important;
}

.navbar .nav-link .notifications-seen {
	color: var(--text-muted);
}

/* Navbar icons — dark red on white background */
.navbar .navbar-nav svg {
	transition: stroke var(--mytheme-transition);
	color: var(--mytheme-700);
}

.navbar .nav-link:hover svg {
	--icon-stroke: var(--mytheme-600) !important;
}

/* Breadcrumbs */
#navbar-breadcrumbs a {
	color: hsl(355, 100%, 40%);
}

#navbar-breadcrumbs a:hover {
	color: hsl(355, 100%, 30%);
}

/* ----------------------------------------------------------
   3. Search Bar — Centered, wider, rounded, red focus
   ---------------------------------------------------------- */
.navbar .navbar-collapse {
	justify-content: center !important;
}

.navbar .search-bar {
	max-width: 520px;
	width: 100%;
}

.navbar .search-bar .search-bar-input,
.navbar .search-bar input[type="text"],
.search-dialog .search-input input {
	border-radius: 20px !important;
	padding-left: 36px !important;
	padding-right: 18px;
	color: hsl(355, 100%, 25%);
	background: hsl(355, 100%, 100%);
	border: 1px solid hsl(355, 100%, 25%) !important;
	transition: all var(--mytheme-transition);
}

/* Ensure search icon doesn't overlap placeholder text */
.navbar .search-bar .search-icon {
	z-index: 1;
}

.navbar .search-bar .search-bar-input:focus,
.navbar .search-bar input[type="text"]:focus,
.search-dialog .search-input input:focus {
	background: hsl(355, 100%, 100%);
	box-shadow: 0 0 0 2px hsla(355, 100%, 25%, 0.6) !important;
}

/* Awesomebar dropdown */
.awesomplete [role="listbox"] {
	border-radius: 12px !important;
	border: 1px solid var(--border-color);
	box-shadow: 0 8px 24px rgba(217, 30, 42, 0.12) !important;
	overflow: hidden;
}

.awesomplete [role="option"]:hover,
.awesomplete [role="option"][aria-selected="true"] {
	background-color: var(--mytheme-50) !important;
}

/* ----------------------------------------------------------
   4. Sidebar — White background with red accents
   ---------------------------------------------------------- */
.layout-side-section,
.desk-sidebar {
	background-color: none;
	border-right: none !important;
}

/* All sidebar text */
.desk-sidebar .sidebar-menu,
.desk-sidebar .sidebar-label,
.desk-sidebar .standard-sidebar-item span,
.desk-sidebar .standard-sidebar-item .sidebar-item-label,
.layout-side-section .sidebar-menu,
.layout-side-section .sidebar-label,
.layout-side-section .standard-sidebar-item span,
.layout-side-section .standard-sidebar-item .sidebar-item-label {
	color: var(--mytheme-sidebar-text);
}

/* Rounded sidebar items with spacing */
.desk-sidebar .standard-sidebar-item,
.layout-side-section .standard-sidebar-item {
	border-radius: var(--mytheme-radius) !important;
	margin: 2px 8px;
	padding: 6px 10px;
	transition: background-color var(--mytheme-transition),
	            transform var(--mytheme-transition),
	            box-shadow var(--mytheme-transition);
}

.desk-sidebar .standard-sidebar-item:hover,
.layout-side-section .standard-sidebar-item:hover,
.layout-side-section .sidebar-label:hover {
	background-color: hsl(355, 100%, 93%) !important;
	transform: translateX(3px);
	color: var(--mytheme-800) !important;
	box-shadow: 0 0 10px rgba(217, 30, 42, 0.25);
}

.desk-sidebar .standard-sidebar-item.selected,
.desk-sidebar .standard-sidebar-item.active,
.layout-side-section .standard-sidebar-item.selected,
.layout-side-section .standard-sidebar-item.active {
	background-color: hsl(355, 100%, 93%);
	box-shadow: 0 0 5px rgba(217, 30, 42, 0.35);
	transform: none;
	color: var(--mytheme-700);
}

/* Section labels — muted, uppercase */
.desk-sidebar .sidebar-label,
.layout-side-section .sidebar-label {
	color: var(--mytheme-sidebar-muted) !important;
	text-transform: uppercase;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	padding: 12px 12px 4px;
}

/* Sidebar icons — red */
.desk-sidebar .sidebar-item-icon,
.desk-sidebar .standard-sidebar-item svg,
.layout-side-section .sidebar-item-icon,
.layout-side-section .standard-sidebar-item svg {
	--icon-stroke: hsl(355, 100%, 40%) !important;
	stroke: hsl(355, 100%, 40%) !important;
	color: hsl(355, 100%, 40%) !important;
}

/* Thin sidebar scrollbar */
.desk-sidebar::-webkit-scrollbar,
.layout-side-section::-webkit-scrollbar {
	width: 4px;
}

.desk-sidebar::-webkit-scrollbar-track,
.layout-side-section::-webkit-scrollbar-track {
	background: transparent;
}

.desk-sidebar::-webkit-scrollbar-thumb,
.layout-side-section::-webkit-scrollbar-thumb {
	background: rgba(217, 30, 42, 0.2);
	border-radius: 10px;
}

.desk-sidebar::-webkit-scrollbar-thumb:hover,
.layout-side-section::-webkit-scrollbar-thumb:hover {
	background: rgba(217, 30, 42, 0.35);
}

/* ----------------------------------------------------------
   5. Page & Content Area — soft gray background
   ---------------------------------------------------------- */
.page-container {
	background: var(--bg-color);
}

.page-body {
	background: transparent;
}

/* Page head — white with red accent border */
.page-head {
	background: var(--bg-color);
	border-top: 3px solid var(--mytheme-600);
	color: var(--text-color);
}

.page-head .page-title .title-text {
	color: var(--heading-color);
	font-weight: 700;
}

/* ----------------------------------------------------------
   6. Cards & Panels — white with soft shadows
   ---------------------------------------------------------- */

/* Remove double borders on nested cards */
.frappe-card .frappe-card {
	border: none;
	box-shadow: none;
}

/* Section headings inside forms */
.section-head,
.form-section .section-head {
	color: var(--mytheme-800) !important;
	font-weight: 600;
}

/* Form dashboard — subtle red top accent */
.form-dashboard-section {
	border-top: 3px solid var(--mytheme-500);
	border-radius: 10px 10px 0 0;
}

/* ----------------------------------------------------------
   7. Buttons — Red primary, subtle defaults
   ---------------------------------------------------------- */

/* Primary button — red */
.btn-primary,
.btn-primary-dark {
	background-color: var(--mytheme-600) !important;
	border-color: var(--mytheme-600) !important;
	color: #ffffff !important;
	border-radius: 8px;
	font-weight: 500;
	transition: all var(--mytheme-transition);
}

.btn-primary:hover,
.btn-primary-dark:hover {
	background-color: var(--mytheme-700) !important;
	border-color: var(--mytheme-700) !important;
	box-shadow: 0 2px 8px rgba(217, 30, 42, 0.3);
	transform: translateY(-1px);
}

.btn-primary:active,
.btn-primary-dark:active {
	background-color: var(--mytheme-800) !important;
	transform: translateY(0);
}

.btn-primary:focus,
.btn-primary-dark:focus {
	box-shadow: 0 0 0 3px rgba(217, 30, 42, 0.3) !important;
}

/* Default / secondary buttons */
.btn-default {
	background-color: var(--subtle-fg) !important;
	border: 1px solid var(--border-color) !important;
	color: var(--text-color) !important;
	border-radius: 8px;
	transition: all var(--mytheme-transition);
}

.btn-default:hover {
	background-color: var(--mytheme-50) !important;
	border-color: var(--mytheme-200) !important;
	color: var(--mytheme-700) !important;
}

.btn-default:focus {
	box-shadow: var(--focus-default) !important;
}

/* Secondary button */
.btn-secondary {
	border-radius: 8px;
	transition: all var(--mytheme-transition);
}

.btn-secondary:hover {
	background-color: var(--mytheme-50) !important;
	color: var(--mytheme-700) !important;
}

/* Icon buttons */
.icon-btn:hover {
	background-color: var(--mytheme-50) !important;
}

/* Like-button / favorite */
.like-active-item .like-action {
	color: var(--mytheme-600) !important;
}

/* ----------------------------------------------------------
   8. Form Controls — Inputs, Selects, Textareas
   ---------------------------------------------------------- */
.form-control,
.frappe-control input,
.frappe-control select,
.frappe-control textarea {
	border-radius: 8px !important;
	border: 1px solid var(--border-color) !important;
	background: var(--control-bg);
	transition: border-color var(--mytheme-transition),
	            box-shadow var(--mytheme-transition);
}

.form-control:focus,
.frappe-control input:focus,
.frappe-control select:focus,
.frappe-control textarea:focus {
	border-color: var(--mytheme-400) !important;
	box-shadow: 0 0 0 3px rgba(217, 30, 42, 0.15) !important;
	outline: none;
}

/* Control labels */
.frappe-control .control-label,
.control-label {
	color: var(--text-muted);
	font-weight: 500;
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Read-only / like-disabled fields */
.like-disabled-input {
	background: var(--disabled-control-bg) !important;
	border-radius: 8px !important;
	color: var(--disabled-text-color) !important;
}

/* Link field — red colored links */
.frappe-control[data-fieldtype="Link"] .control-value a,
.frappe-control .link-btn {
	color: var(--mytheme-600) !important;
}

.frappe-control[data-fieldtype="Link"] .control-value a:hover,
.frappe-control .link-btn:hover {
	color: var(--mytheme-700) !important;
}

/* ----------------------------------------------------------
   9. List View — Clean rows with red accents
   ---------------------------------------------------------- */
.frappe-list .list-row-head {
	background: var(--subtle-fg) !important;
	border-radius: 8px 8px 0 0;
}

.frappe-list .list-row {
	border-bottom: 1px solid var(--border-color);
	transition: background-color var(--mytheme-transition);
}

.frappe-list .list-row:hover {
	background-color: var(--mytheme-50) !important;
}

.frappe-list .list-row a {
	color: var(--text-color);
}

.frappe-list .list-row a:hover {
	color: var(--mytheme-600);
}

/* List sidebar labels — red */
.list-sidebar .sidebar-label,
.list-sidebar .list-sidebar-label {
	color: var(--mytheme-700) !important;
	font-weight: 600;
	text-transform: uppercase;
	font-size: 0.68rem;
	letter-spacing: 0.05em;
}

/* Paging area */
.list-paging-area {
	border-top: 1px solid var(--border-color);
}

/* ----------------------------------------------------------
   10. Indicators & Badges — Use Frappe defaults but boost contrast
   ---------------------------------------------------------- */
.indicator-pill {
	border-radius: 20px;
	font-weight: 500;
}

.indicator-pill.green {
	background: var(--green-100);
	color: var(--green-700);
}

.indicator-pill.blue {
	background: var(--blue-100);
	color: var(--blue-700);
}

.indicator-pill.red {
	background: var(--red-100);
	color: var(--red-700);
}

.indicator-pill.orange {
	background: var(--orange-100);
	color: var(--orange-700);
}

/* ----------------------------------------------------------
   11. Modals & Dialogs — Red accent header
   ---------------------------------------------------------- */
.modal-content {
	border-radius: 12px !important;
	border: none !important;
	box-shadow: 0 16px 48px rgba(217, 30, 42, 0.15) !important;
	overflow: hidden;
}

.modal-header {
	background: var(--fg-color);
	border-bottom: 2px solid var(--mytheme-500);
	padding: 16px 20px;
}

.modal-header .modal-title {
	color: var(--heading-color);
	font-weight: 600;
}

.modal-footer {
	border-top: 1px solid var(--border-color);
}

/* ----------------------------------------------------------
   12. Dropdowns & Popovers
   ---------------------------------------------------------- */
.dropdown-menu {
	border-radius: 10px !important;
	border: 1px solid var(--border-color) !important;
	box-shadow: 0 8px 24px rgba(217, 30, 42, 0.12) !important;
	overflow: hidden;
	padding: 4px !important;
}

.dropdown-item {
	border-radius: 6px;
	transition: background-color var(--mytheme-transition),
	            color var(--mytheme-transition);
	margin: 1px 0;
}

.dropdown-item:hover,
.dropdown-item:focus {
	background-color: var(--mytheme-50) !important;
	color: var(--mytheme-700) !important;
}

.dropdown-item.active,
.dropdown-item:active {
	background-color: var(--mytheme-100) !important;
	color: var(--mytheme-800) !important;
}

/* ----------------------------------------------------------
   13. Tabs & Navs
   ---------------------------------------------------------- */
.nav-tabs .nav-link {
	border-radius: 8px 8px 0 0;
	transition: color var(--mytheme-transition),
	            border-color var(--mytheme-transition);
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-link:hover {
	color: var(--mytheme-600) !important;
}

.nav-tabs .nav-link.active {
	border-bottom: 2px solid var(--mytheme-600) !important;
}

/* Form tabs */
.form-tabs .nav-link.active {
	color: var(--mytheme-600) !important;
	border-bottom-color: var(--mytheme-600) !important;
}

/* ----------------------------------------------------------
   14. Alerts & Messages
   ---------------------------------------------------------- */
.alert {
	border-radius: 10px;
	border: none;
}

.desk-alert {
	border-radius: 0;
}

.msgprint {
	border-radius: 10px;
}

/* ----------------------------------------------------------
   15. Progress Bars & Loaders
   ---------------------------------------------------------- */
.progress-bar {
	background-color: var(--mytheme-500) !important;
	border-radius: 20px;
}

.progress {
	border-radius: 20px;
	background-color: var(--subtle-fg);
}

/* ----------------------------------------------------------
   16. Timeline & Comments
   ---------------------------------------------------------- */
.timeline-item {
	border-left-color: var(--border-color) !important;
}

.timeline-dot {
	border-color: var(--mytheme-500) !important;
}

.comment-box .mention-input-field .ql-editor:focus {
	border-color: var(--mytheme-400) !important;
	box-shadow: 0 0 0 3px rgba(217, 30, 42, 0.15) !important;
}

/* ----------------------------------------------------------
   17. Checkbox & Radio — Red accent when checked
   ---------------------------------------------------------- */
.frappe-control input[type="checkbox"]:checked {
	background-color: var(--mytheme-600) !important;
	border-color: var(--mytheme-600) !important;
}

/* ----------------------------------------------------------
   18. Links — Red everywhere
   ---------------------------------------------------------- */
a {
	color: var(--mytheme-600);
	transition: color var(--mytheme-transition);
}

a:hover {
	color: var(--mytheme-700);
}

/* Don't override sidebar link colors */
.desk-sidebar a,
.layout-side-section a {
	color: var(--mytheme-sidebar-text) !important;
}

/* ----------------------------------------------------------
   19. Workspace / Module view cards
   ---------------------------------------------------------- */
.widget.shortcut-widget-box {
	border-radius: 10px !important;
	padding: 12px 16px !important;
	transition: all var(--mytheme-transition);
}

.widget.shortcut-widget-box:hover {
	box-shadow: 0 4px 10px rgba(217, 30, 42, 0.35);
	transform: translateY(-2px);
}

/* Spacer widget — no border or background */
.widget.spacer-widget-box,
.spacer-widget-box {
	border: none !important;
	box-shadow: none !important;
	background: transparent !important;
}

.widget.onboarding-widget-box {
	border-radius: 12px !important;
	background-color: none !important;
}

/* Number cards */
.number-widget-box {
	border-radius: 12px !important;
}

.number-widget-box .widget-head .widget-title {
	color: var(--text-muted);
}

/* ----------------------------------------------------------
   22. Page-level scrollbar — Thin & red-tinted
   ---------------------------------------------------------- */
::-webkit-scrollbar {
	width: 7px;
	height: 7px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background: rgba(217, 30, 42, 0.2);
	border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
	background: rgba(217, 30, 42, 0.35);
}

/* Sidebar scrollbar — lighter */
.desk-sidebar::-webkit-scrollbar-thumb,
.layout-side-section::-webkit-scrollbar-thumb {
	background: rgba(217, 30, 42, 0.15);
}

.desk-sidebar::-webkit-scrollbar-thumb:hover,
.layout-side-section::-webkit-scrollbar-thumb:hover {
	background: rgba(217, 30, 42, 0.3);
}

/* ----------------------------------------------------------
   23. Transitions & Polish — Selection, Focus
   ---------------------------------------------------------- */
::selection {
	background: var(--mytheme-200);
	color: var(--mytheme-900);
}

/* Smooth focus for all interactive elements */
*:focus-visible {
	outline: 2px solid var(--mytheme-400);
	outline-offset: 2px;
}

/* Page loading bar */
.nprogress .bar {
	background: var(--mytheme-500) !important;
}

.nprogress .peg {
	box-shadow: 0 0 10px var(--mytheme-400), 0 0 5px var(--mytheme-400) !important;
}

/* ----------------------------------------------------------
   24. Report View & Print
   ---------------------------------------------------------- */
.report-wrapper .dt-scrollable {
	border-radius: 8px;
}

.report-wrapper .dt-cell--header {
	background: var(--subtle-fg) !important;
}

.dt-row:hover .dt-cell {
	background: var(--mytheme-50) !important;
}

/* ----------------------------------------------------------
   25. Workspace icons — red tint
   ---------------------------------------------------------- */
.workspace-sidebar-item .sidebar-item-icon {
	background: var(--mytheme-50);
	border-radius: 8px;
}

input[type=checkbox]:checked {
  background-color: var(--primary);
  background-size: 100%, 100%;
  box-shadow: none;
  border: none;
}