/* Oregano ERP — Global Custom Calendar, Month & Year Picker */
/* Pixel-perfect match for Oregano Figma design: sharp corners, Forum serif font, olive header */

:root {
  --og-cal-olive: var(--oregano-olive, rgb(134, 137, 32));
  --og-cal-olive-dark: #5c611d;
  --og-cal-btn-hover-bg: #5c4616;
  --og-cal-btn-hover-text: #ffffff;
  --og-cal-olive-light: rgba(134, 137, 32, 0.15);
  --og-cal-text: #222222;
  --og-cal-border: #9e9e9e;
  --og-cal-btn-border: #666666;
  --og-cal-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Custom Calendar Popup Container (Sharp 0px corners, crisp border) */
.oregano-calendar-popup {
  position: absolute;
  z-index: 2000;
  width: 333px;
  height: 293px;
  max-width: 333px;
  max-height: 293px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--og-cal-border);
  border-radius: 0;
  box-shadow: var(--og-cal-shadow);
  font-family: "Forum", Georgia, serif;
  user-select: none;
  overflow: hidden;
  box-sizing: border-box;
}

/* Calendar Header (Olive green banner with white year/month text) */
.oregano-cal-header {
  background-color: var(--og-cal-olive);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-family: "Forum", Georgia, serif;
  font-weight: normal;
  font-size: 18px;
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
}

.oregano-cal-header-title {
  cursor: pointer;
  padding: 0 4px;
  color: #ffffff;
  font-family: "Forum", Georgia, serif;
  letter-spacing: 0.5px;
}

.oregano-cal-nav-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: opacity 0.15s;
}

.oregano-cal-nav-btn:hover {
  opacity: 1;
  color: #ffffff;
}

.oregano-cal-nav-btn svg {
  width: 8px;
  height: 10px;
}

/* Calendar Body */
.oregano-cal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 14px 6px 14px;
  background: #ffffff;
  box-sizing: border-box;
  overflow: hidden;
}

/* Month & Year 3x4 Grid */
.oregano-cal-grid-3x4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  flex: 1;
  row-gap: 8px;
  column-gap: 8px;
  align-items: stretch;
}

.oregano-cal-grid-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  font-family: "Forum", Georgia, serif;
  font-size: 16px;
  color: var(--og-cal-text);
  cursor: pointer;
  border-radius: 0;
  border: 1px solid transparent;
  transition: background-color 0.1s, color 0.1s;
}

.oregano-cal-grid-item:hover {
  background-color: var(--og-cal-olive);
  color: var(--og-cal-text);
}

.oregano-cal-grid-item.is-selected {
  border: 1px solid var(--og-cal-olive);
  color: var(--og-cal-olive-dark);
  font-weight: bold;
}

.oregano-cal-grid-item.is-current {
  color: var(--og-cal-olive);
  font-weight: bold;
}

/* Days Calendar Grid (7 columns) */
.oregano-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-family: "Forum", Georgia, serif;
  font-size: 13px;
  font-weight: 600;
  color: #777777;
  margin-bottom: 4px;
}

.oregano-cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  flex: 1;
  gap: 2px;
}

.oregano-cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Forum", Georgia, serif;
  font-size: 13.5px;
  color: var(--og-cal-text);
  cursor: pointer;
  border-radius: 0;
  border: 1px solid transparent;
  transition: background-color 0.1s, color 0.1s;
}

.oregano-cal-day:hover {
  background-color: var(--og-cal-olive);
  color: var(--og-cal-text);
}

.oregano-cal-day.is-other-month {
  color: #c4c4c4;
}

.oregano-cal-day.is-selected {
  border: 1px solid var(--og-cal-olive);
  color: var(--og-cal-olive-dark);
  font-weight: bold;
}

.oregano-cal-day.is-today {
  color: var(--og-cal-olive);
  font-weight: bold;
}

/* Calendar Footer */
.oregano-cal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px 10px 14px;
  height: 42px;
  min-height: 42px;
  background-color: #ffffff;
  box-sizing: border-box;
}

.oregano-cal-btn {
  background: #ffffff;
  border: 1px solid var(--og-cal-btn-border);
  border-radius: 0;
  color: #222222;
  font-family: "Forum", Georgia, serif;
  font-size: 13px;
  padding: 3px 12px;
  cursor: pointer;
  line-height: 1.4;
  transition: all 0.1s;
}

.oregano-cal-btn:hover {
  background-color: var(--og-cal-btn-hover-bg, #5c4616);
  border-color: var(--og-cal-btn-hover-bg, #5c4616);
  color: var(--og-cal-btn-hover-text, #ffffff);
}

/* Custom Input Styling (Matches photo: sharp corners and calendar icon) */
.oregano-picker-input {
  font-family: "Forum", Georgia, serif;
  color: var(--oregano-ink, #212529);
  cursor: pointer;
  border-radius: 0;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239e9e9e' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 16px;
  padding-right: 2.25rem;
}

.oregano-picker-input::placeholder {
  color: var(--oregano-ink, #212529);
  font-family: "Forum", Georgia, serif;
  opacity: 1;
}

.date-hint:not(:focus):not(.has-value)::before {
  color: var(--oregano-ink, #212529);
  font-family: "Forum", Georgia, serif;
}

input[type="date"],
input[type="month"] {
  border-radius: 0;
  font-family: "Forum", Georgia, serif;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
}
