:root {
    --mc-brand: #f99e23;
    --mc-brand-dark: #e08a10;
    --mc-danger: #dc2626;
    --mc-danger-dark: #b91c1c;
    --mc-gray: #6c757d;
    --mc-gray-dark: #212529;
    --mc-tooltip-bg: #333;
    --mc-sidebar-width: 160px;
    --mc-hover-bg: rgb(0 0 0 / 0.06);
}

/* ── Layout ── */
.mc-body {
    background: #fff;
    margin: 0;
}

.mc-sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: var(--mc-sidebar-width) !important;
    background: #fff !important;
    z-index: 1000;
    overflow: visible;
}

.mc-main {
    margin-left: var(--mc-sidebar-width) !important;
    min-height: 100vh;
    padding: 0 1rem 2rem 0 !important;
    background: #fff;
}

/* ── Sidebar brand / logo ── */
.mc-sidebar-brand {
    border-bottom: 1px solid #e9ecef;
}

.mc-logo {
    width: 80px;
    display: block;
    margin: 20px auto 40px;
}

.mc-logo-wrap {
    position: relative;
    cursor: default;
}

/* Shared tooltip base — dark bubble style used by .mc-logo-tip, .mc-nav-tip and
   .fc-event-tip. Each specific class only overrides positioning/sizing. */
.mc-tooltip {
    display: none;
    background: var(--mc-tooltip-bg);
    color: #fff;
    font-size: .75rem;
    padding: .4rem .7rem;
    border-radius: 6px;
    z-index: 9999;
}

.mc-logo-tip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    white-space: normal;
    width: 200px;
    line-height: 1.4;
}

.mc-logo-wrap:hover .mc-logo-tip {
    display: block;
}

/* ── Nav links ── */
.mc-nav-link {
    color: #6c757d !important;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    transition: background .15s, color .15s;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    margin: 0 auto 16px;
    position: relative;
}

.mc-nav-link .mc-nav-tip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    pointer-events: none;
}

.mc-nav-link:hover .mc-nav-tip {
    display: block;
}

.mc-nav-link:hover,
.mc-nav-link.active {
    background: var(--mc-hover-bg);
    color: var(--mc-brand) !important;
}

/* ── Tabs ── */
.nav-tabs .nav-link {
    color: #6c757d;
}

.nav-tabs .nav-link:hover {
    background: var(--mc-hover-bg) !important;
    color: var(--mc-brand);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--mc-brand);
    font-weight: 600;
    border-color: #dee2e6 #dee2e6 #fff;
}

/* ── Sidebar footer ── */
.mc-sidebar-footer {
    border-top: 1px solid #e9ecef;
    font-size: .85rem;
}

/* ── Page header ── */
.mc-page-header {
    background: var(--mc-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.6rem 1.5rem;
    margin: 0 -1rem 2rem 0;
    border-bottom-left-radius: 12px;
}

.mc-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.mc-page-company {
    font-size: .85rem;
    opacity: .85;
    margin-top: .15rem;
}

.mc-page-user {
    font-size: .9rem;
    font-weight: 500;
}

/* ── Mobile topbar ── */
.mc-topbar {
    background: var(--mc-brand);
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 999;
}

/* ── Data table (sticky header) ── */
.mc-table-scroll {
    overflow-x: auto;
}

.mc-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8f9fa;
}

/* ── Stat cards ── */
.mc-stat-card {
    border-top: 4px solid var(--mc-brand);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    transition: box-shadow .15s, background .15s;
    position: relative;
}

a.mc-stat-card:hover {
    background: var(--mc-hover-bg);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    color: inherit;
}

/* ── Stat card — structured layout ── */
.mc-stat-card-row {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.mc-stat-card-icon {
    flex: 0 0 auto;
    width: 2rem;
    text-align: left;
    font-size: 1.25rem;
}

.mc-stat-card-title {
    flex: 1 1 auto;
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
}

.mc-stat-card-count {
    flex: 0 0 auto;
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    line-height: 1;
}

.mc-stat-card-sub {
    margin-top: .6rem;
    font-size: .8rem;
    color: #6c757d;
}

/* ── Brand button ── */
.btn-mc {
    display: inline-block;
    background: var(--mc-brand);
    border: 1px solid var(--mc-brand);
    color: #fff !important;
    padding: .45rem .9rem;
    border-radius: 6px;
    font-size: .9rem;
    text-decoration: none !important;
    transition: background .15s, color .15s;
}

.btn-mc:hover {
    background: var(--mc-brand-dark);
    border-color: var(--mc-brand-dark);
    color: #fff;
}

.btn-mc-outline {
    display: inline-block;
    background: #f0f0f0;
    border: 1px solid transparent;
    color: #6c757d !important;
    padding: .45rem .9rem;
    border-radius: 6px;
    font-size: .9rem;
    text-decoration: none !important;
    transition: background .15s, color .15s;
}

.btn-mc-outline:hover {
    background: #d0d0d0;
    color: #333;
}

.btn-mc-sm,
.btn-mc-outline-sm {
    padding: .15rem .55rem;
    font-size: .85rem;
}

.btn-mc-danger {
    display: inline-block;
    background: var(--mc-danger);
    border: 1px solid var(--mc-danger);
    color: #fff !important;
    padding: .45rem .9rem;
    border-radius: 6px;
    font-size: .9rem;
    text-decoration: none !important;
    transition: background .15s, color .15s;
}

.btn-mc-danger:hover {
    background: var(--mc-danger-dark);
    border-color: var(--mc-danger-dark);
    color: #fff;
}

.btn-mc-outline-danger {
    display: inline-block;
    background: #f0f0f0;
    border: 1px solid var(--mc-danger);
    color: var(--mc-danger) !important;
    padding: .45rem .9rem;
    border-radius: 6px;
    font-size: .9rem;
    text-decoration: none !important;
    transition: background .15s, color .15s;
}

.btn-mc-outline-danger:hover {
    background: var(--mc-danger);
    color: #fff !important;
}

/* Bare Bootstrap .btn used for the mobile sidebar toggler across every role's sidebar
   partial — plain .btn has no hover background of its own without a colour variant.
   !important throughout this block guards against Bootstrap's own CSS, which the
   bootstrap.index Stimulus controller re-appends to <head> at runtime (after this
   stylesheet), so an equal-specificity Bootstrap rule loaded later would otherwise win. */
#sidebarToggle:hover {
    background: var(--mc-hover-bg) !important;
}

.table-hover > tbody > tr:hover > * {
    --bs-table-hover-bg: var(--mc-hover-bg) !important;
    background-color: var(--mc-hover-bg) !important;
}

/* ── List page header (title + action buttons row) ── */
.mc-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* ── Mobile hamburger icon, inverted for dark topbar ── */
.navbar-toggler-icon-light {
    filter: invert(1);
}

/* ── Mobile: hide sidebar, show topbar ── */
@media (max-width: 991.98px) {
    .mc-sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    .mc-sidebar.open {
        transform: translateX(0);
    }
    .mc-main {
        margin-left: 0;
        padding-top: 1rem;
    }
}

/* ── FullCalendar overrides ── */
.fc .fc-button-primary {
    background: var(--mc-brand) !important;
    border-color: var(--mc-brand) !important;
    color: #fff !important;
}

.fc .fc-button-primary:hover {
    background: var(--mc-brand-dark) !important;
    border-color: var(--mc-brand-dark) !important;
}

.fc .fc-button-primary:disabled {
    background: var(--mc-brand) !important;
    border-color: var(--mc-brand) !important;
    opacity: .65 !important;
}

.fc .fc-button-primary.fc-button-active {
    background: var(--mc-brand-dark) !important;
    border-color: var(--mc-brand-dark) !important;
}

.fc .fc-toolbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #212529;
}

.fc .fc-col-header-cell {
    background: #f8f9fa;
    font-weight: 600;
    font-size: .85rem;
    color: #6c757d;
}

.fc .fc-daygrid-day-number {
    font-size: .85rem;
    color: #495057;
}

.fc .fc-day-today {
    background: #fff8f0 !important;
}

.fc .fc-daygrid-day:hover,
.fc .fc-daygrid-day:hover .fc-daygrid-day-frame {
    background: var(--mc-hover-bg) !important;
    cursor: pointer;
    transition: background .15s;
}

/* timeGridWeek/timeGridDay view — a separate set of elements from the dayGridMonth
   cells above (.fc-timegrid-slot-lane is the clickable background of each time slot;
   .fc-timegrid-col is the whole day column), previously unstyled on hover. */
.fc .fc-timegrid-slot-lane:hover,
.fc .fc-timegrid-col.fc-day:hover {
    background: var(--mc-hover-bg) !important;
    cursor: pointer;
    transition: background .15s;
}

.fc .fc-event {
    border-radius: 4px;
    font-size: .8rem;
    border: none;
}

.fc a {
    color: #212529 !important;
}

.fc .fc-event a {
    color: #fff !important;
}

/* Sitewide hover tooltip — applied to [data-tip] elements and to FullCalendar
   event tooltips. The element is appended to <html> so font-family won't
   inherit from <body>; pin it to the Bootstrap body stack explicitly. */
.fc-event-tip {
    position: fixed;
    font-family: var(--bs-body-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif), sans-serif;
    white-space: nowrap;
    z-index: 99999;
    pointer-events: none;
    line-height: 1.5;
}
