/* ERP Elitse — calendar.css */

/* ---------- Toolbar ---------- */
.cal-toolbar {
    padding: 14px var(--sp-5);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    flex-wrap: wrap;
}

.cal-toolbar-left,
.cal-toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.cal-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-medium);
    min-width: 160px;
    text-transform: capitalize;
}

.nav-arrow {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    background: var(--white);
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-arrow:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.nav-arrow i { font-size: 18px; }

.btn-today {
    height: 28px;
    padding: 0 var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-today:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

/* ---------- View toggle (segmented control) ---------- */
.view-toggle {
    display: inline-flex;
    background: var(--primary-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2px;
    gap: 2px;
}

.view-toggle button {
    height: 24px;
    padding: 0 var(--sp-3);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text-muted);
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.view-toggle button:hover {
    color: var(--text);
}

.view-toggle button.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

/* ---------- Filter bar ---------- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-5);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    white-space: nowrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    color: var(--text-muted);
    background: var(--white);
    cursor: pointer;
    flex: 0 0 auto;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pill:hover {
    border-color: var(--primary-light);
    color: var(--text);
}

.pill.active {
    background: rgba(78, 128, 114, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.pill-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
    background: var(--primary);
    flex: 0 0 auto;
}

/* ---------- Calendar views container ---------- */
.cal-views {
    flex: 1 1 auto;
    overflow: auto;
}

/* ---------- Week grid ---------- */
.week-grid {
    display: grid;
    grid-template-columns: 52px repeat(7, 1fr);
    min-width: 720px;
}

.week-header {
    display: contents;
}

.wh-corner {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 2;
}

.wh-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--sp-2) 0;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 2;
}

.wh-day .wh-name {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: var(--fw-semibold);
}

.wh-day .wh-num {
    font-size: var(--fs-md);
    font-weight: var(--fw-medium);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.wh-day.today .wh-num {
    background: var(--primary);
    color: var(--white);
}

.wh-day.today .wh-name {
    color: var(--primary);
}

/* Time labels column */
.time-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: right;
    padding: 2px 6px 0 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--white);
}

/* Day cells */
.day-cell {
    min-height: 44px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 2px;
    position: relative;
}

.day-cell:hover {
    background: var(--primary-bg);
}

/* ---------- Events ---------- */
.event {
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--primary);
    padding: 3px 6px;
    font-size: var(--fs-xs);
    margin-bottom: 2px;
    overflow: hidden;
    cursor: pointer;
    line-height: 1.3;
}

.event .ev-time {
    font-weight: var(--fw-semibold);
    opacity: 0.9;
}

.event .ev-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ev-green {
    background: var(--green-soft);
    border-left-color: var(--primary);
    color: var(--primary-dark);
}

.ev-amber {
    background: var(--amber-soft);
    border-left-color: var(--amber);
    color: var(--amber-dark);
}

.ev-blue {
    background: var(--blue-soft);
    border-left-color: var(--blue);
    color: var(--blue-dark);
}

.ev-gray {
    background: var(--gray-soft);
    border-left-color: var(--text-muted);
    color: var(--text-muted);
}

/* ---------- List view ---------- */
.list-view {
    padding: var(--sp-4) var(--sp-5);
    max-width: 820px;
}

.list-day-group {
    margin-bottom: var(--sp-5);
}

.list-day-header {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding-bottom: var(--sp-2);
    margin-bottom: var(--sp-2);
    border-bottom: 1px solid var(--border);
}

.list-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: var(--sp-2);
    transition: box-shadow 0.15s ease;
}

.list-item:hover {
    box-shadow: var(--shadow-sm);
}

.list-item .li-time {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    width: 56px;
    flex: 0 0 56px;
}

.list-item .li-bar {
    width: 3px;
    align-self: stretch;
    border-radius: var(--radius-full);
    background: var(--primary);
    flex: 0 0 3px;
}

.list-item .li-info {
    flex: 1 1 auto;
    min-width: 0;
}

.list-item .li-title {
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item .li-sub {
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.list-item .li-price {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    flex: 0 0 auto;
}

.list-item .li-badge {
    flex: 0 0 auto;
}

/* List item color bar variants */
.list-item.li-amber .li-bar { background: var(--amber); }
.list-item.li-blue .li-bar { background: var(--blue); }
.list-item.li-gray .li-bar { background: var(--text-muted); }

/* ---------- Day view (single column) ---------- */
.day-view {
    display: grid;
    grid-template-columns: 52px 1fr;
    min-width: 360px;
}

.day-view .time-label {
    border-right: 1px solid var(--border);
}

.day-view .day-col-cell {
    min-height: 48px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 2px 6px;
    position: relative;
}

.day-view .day-col-cell:hover {
    background: var(--primary-bg);
}

.day-view-header {
    grid-column: 1 / -1;
    padding: var(--sp-3) var(--sp-5);
    border-bottom: 1px solid var(--border);
    font-size: var(--fs-md);
    font-weight: var(--fw-medium);
    background: var(--white);
    text-transform: capitalize;
}

/* ---------- Month view ---------- */
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-collapse: collapse;
    border-top: 0.5px solid var(--border);
    border-left: 0.5px solid var(--border);
}

.month-header {
    display: contents;
}

.month-header .month-dow {
    padding: var(--sp-2) var(--sp-2);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    background: var(--primary-bg);
    border-right: 0.5px solid var(--border);
    border-bottom: 0.5px solid var(--border);
    text-align: center;
}

.month-cell {
    min-height: 80px;
    border-right: 0.5px solid var(--border);
    border-bottom: 0.5px solid var(--border);
    padding: 6px;
    cursor: pointer;
    overflow: hidden;
    transition: background 0.15s ease;
}

.month-cell:hover {
    background: var(--primary-bg);
}

.month-cell.today {
    border-top: 2px solid var(--primary);
}

.month-cell.weekend {
    background: rgba(78, 128, 114, 0.04);
}

.month-cell.weekend:hover {
    background: var(--primary-bg);
}

.month-cell.other-month {
    opacity: 0.35;
}

.month-day-num {
    font-size: 12px;
    font-weight: var(--fw-medium);
    margin-bottom: 4px;
}

.month-event {
    font-size: 10px;
    border-radius: 3px;
    padding: 2px 5px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid var(--primary);
    cursor: pointer;
}

.month-more {
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
}
