/* ==========================================================================
   HUNAGUND FPO - CROP CALENDAR STYLES (v2.0)
   Master Agronomic Sowing, Cultivation & Harvest Schedule
   ========================================================================== */

/* Calendar Page Hero Header */
.header-crop-calendar {
  background: linear-gradient(rgba(17, 42, 29, 0.88), rgba(17, 42, 29, 0.92)), url('../uploads/banner-02.jpeg') center/cover no-repeat;
  padding: 5rem 0 3.5rem;
  color: #ffffff;
  text-align: center;
}

/* Control & Filter Bar (Consistent Single Row on Desktop, Structured 2-Row on Tablet) */
.calendar-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  background: var(--neutral-0, #ffffff);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md, 14px);
  box-shadow: 0 4px 20px rgba(17, 42, 29, 0.06);
  border: 1px solid var(--neutral-200, #e2e9e4);
  margin-bottom: 1.5rem;
  flex-wrap: nowrap;
}

.calendar-search-wrap {
  position: relative;
  width: 220px;
  min-width: 180px;
  max-width: 240px;
  flex-shrink: 0;
}

.calendar-search-wrap input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.25rem;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid var(--neutral-300, #c4d3ca);
  background: var(--neutral-100, #f4f7f5);
  font-size: 0.86rem;
  color: var(--neutral-800, #16241a);
  outline: none;
  transition: all var(--transition-fast, 0.2s);
}

.calendar-search-wrap input:focus {
  border-color: var(--primary-medium, #2d6a4f);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.calendar-search-wrap i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--neutral-400, #94a79b);
  pointer-events: none;
  font-size: 0.85rem;
}

/* Filter Buttons */
.calendar-filters-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  flex-shrink: 1;
}

.cal-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid var(--neutral-300, #c4d3ca);
  background: #ffffff;
  color: var(--neutral-700, #293a2e);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast, 0.2s);
}

.cal-filter-btn:hover {
  background: var(--primary-subtle, #eef5f0);
  border-color: var(--primary-light, #40916c);
  color: var(--primary-dark, #112a1d);
}

.cal-filter-btn.active {
  background: var(--primary-main, #1b4332);
  color: #ffffff;
  border-color: var(--primary-main, #1b4332);
  box-shadow: 0 3px 10px rgba(27, 67, 50, 0.25);
}

.cal-filter-btn .badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.08);
}

.cal-filter-btn.active .badge-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Kannada Typography compact padding to ensure exact single-line alignment */
body.lang-kn .cal-filter-btn,
html[lang="kn"] .cal-filter-btn {
  padding: 0.42rem 0.72rem;
  font-size: 0.82rem;
}

body.lang-kn .cal-action-btn,
html[lang="kn"] .cal-action-btn {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
}

/* Actions: Print / PDF */
.calendar-actions-group {
  display: flex;
  flex-shrink: 0;
}

.cal-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--neutral-300, #c4d3ca);
  background: #ffffff;
  color: var(--primary-main, #1b4332);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast, 0.2s);
}

.cal-action-btn:hover {
  background: var(--primary-subtle, #eef5f0);
  border-color: var(--primary-medium, #2d6a4f);
}

/* Responsive consistency: Ensure balanced 2-row layout on medium screens without 3-row breaking */
@media (max-width: 1040px) and (min-width: 681px) {
  .calendar-controls-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.75rem;
  }
  .calendar-filters-group {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }
  .calendar-search-wrap {
    grid-column: 1;
    width: 100%;
    max-width: 320px;
  }
  .calendar-actions-group {
    grid-column: 2;
    justify-content: flex-end;
  }
}

@media (max-width: 680px) {
  .calendar-controls-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .calendar-search-wrap {
    width: 100%;
    max-width: 100%;
  }
  .calendar-filters-group {
    overflow-x: auto;
    padding-bottom: 0.35rem;
  }
  .calendar-actions-group {
    align-self: flex-start;
  }
}

/* Scroll Hint for Mobile/Tablet */
.calendar-scroll-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--neutral-600, #465a4c);
  margin-bottom: 0.6rem;
  text-align: right;
  justify-content: flex-end;
}

/* ==========================================================================
   STICKY CALENDAR VIEWPORT CONTAINER (Sticky on Scroll)
   ========================================================================== */
.calendar-viewport-card {
  background: #ffffff;
  border-radius: var(--radius-md, 14px);
  border: 1px solid #d8e2dc;
  box-shadow: 0 8px 30px rgba(17, 42, 29, 0.08);
  margin-bottom: 2rem;
  position: relative;
}

/* Scrollable container with vertical and horizontal sticky behavior */
.calendar-scrollable-container {
  overflow: auto;
  max-height: 75vh;
  position: relative;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md, 14px);
}

/* Custom sleek scrollbar for smooth dragging */
.calendar-scrollable-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.calendar-scrollable-container::-webkit-scrollbar-track {
  background: #f1f5f2;
}
.calendar-scrollable-container::-webkit-scrollbar-thumb {
  background: #b5c7bd;
  border-radius: 4px;
}
.calendar-scrollable-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary-medium, #2d6a4f);
}

/* Main Table */
.crop-calendar-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-family: var(--font-body);
}

/* Sticky Table Header (Pinned on Vertical Scroll) */
.crop-calendar-table thead th {
  background: #0d2818;
  color: #ffffff;
  padding: 0.85rem 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 2px solid #06190e;
  position: sticky;
  top: 0;
  z-index: 30;
  user-select: none;
}

.crop-calendar-table thead th:last-child {
  border-right: none;
}

/* Sticky Top-Left Corner: CROP Header (Pinned Vertically AND Horizontally) */
.crop-calendar-table thead th.col-crop {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 50;
  background: #071d10;
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  border-right: 2px solid #05140b;
  box-shadow: 4px 2px 10px rgba(0, 0, 0, 0.2);
}

/* Sub-fortnight Indicators under Months */
.month-fortnights {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 0.25rem;
  padding: 0 0.4rem;
  font-weight: 500;
  letter-spacing: normal;
}

/* ==========================================================================
   CATEGORY HEADER ROW (Single Line, Sticky, Spanning Full Width)
   ========================================================================== */
.tr-category-header td {
  background: #edf5f0;
  color: #112a1d;
  padding: 0.75rem 1.25rem;
  border-top: 2px solid #b7d7c5;
  border-bottom: 2px solid #b7d7c5;
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 15;
}

.category-header-single-line {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #112a1d;
  white-space: nowrap;
}

.category-header-single-line i {
  color: var(--primary-main, #1b4332);
  font-size: 1.1rem;
}

/* ==========================================================================
   CROP ROWS & IDENTITY COLUMN (NO THUMBNAILS)
   ========================================================================== */
.tr-crop-row {
  border-bottom: 1px solid #e2ebe5;
  transition: background var(--transition-fast, 0.2s);
}

.tr-crop-row:hover {
  background: #f7faf8;
}

.tr-crop-row:hover .col-crop {
  background: #f1f7f3;
}

/* Sticky First Column for Crop Names */
.crop-calendar-table tbody td.col-crop {
  position: sticky;
  left: 0;
  z-index: 20;
  background: #ffffff;
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  padding: 0.95rem 1.25rem;
  vertical-align: middle;
  border-right: 2px solid #dbe6df;
  border-bottom: 1px solid #e2ebe5;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
}

/* Pure Crop Name Typography */
.crop-name-only {
  font-size: 0.95rem;
  font-weight: 800;
  color: #112a1d;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.3;
}

.crop-season-tag {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.crop-season-tag.kharif {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #c8e6c9;
}

.crop-season-tag.rabi {
  background: #e3f2fd;
  color: #0d47a1;
  border: 1px solid #bbdefb;
}

.crop-season-tag.summer {
  background: #fff8e1;
  color: #e65100;
  border: 1px solid #ffe082;
}

.crop-season-tag.perennial {
  background: #f3e5f5;
  color: #4a148c;
  border: 1px solid #e1bee7;
}

/* ==========================================================================
   TIMELINE MONTH CELL AREA & BARS
   ========================================================================== */
.col-timeline-grid {
  padding: 0.75rem 0.25rem;
  vertical-align: middle;
  background: #ffffff;
  position: relative;
  border-bottom: 1px solid #e2ebe5;
}

.timeline-grid-wrapper {
  position: relative;
  width: 100%;
  height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

/* Subtle Vertical Gridlines for Fortnights */
.timeline-grid-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  pointer-events: none;
  z-index: 1;
}

.grid-cell-fn {
  border-right: 1px dashed rgba(220, 230, 224, 0.7);
}

.grid-cell-fn:nth-child(2n) {
  border-right: 1px solid #d4ded8;
}

.grid-cell-fn:last-child {
  border-right: none;
}

.grid-cell-fn.is-current-fn {
  background-color: rgba(212, 154, 55, 0.08);
}

/* Timeline Track Rows */
.timeline-track-row {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
  z-index: 2;
}

/* Timeline Activity Bars */
.cal-bar {
  position: absolute;
  height: 14px;
  border-radius: 4px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  z-index: 3;
}

.cal-bar:hover {
  transform: scaleY(1.3);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

/* 1. Sowing Period - Yellow/Amber */
.bar-sowing {
  background: #f1b000;
  background: linear-gradient(180deg, #fdc830 0%, #f39c12 100%);
  border: 1px solid #d88900;
}

/* 2. Growing & Hybridisation Period - Green */
.bar-growing {
  background: #38a169;
  background: linear-gradient(180deg, #48bb78 0%, #2f855a 100%);
  border: 1px solid #276749;
}

/* 3. Harvesting Period - Earth / Terracotta Brown */
.bar-harvest {
  background: #9c6f5e;
  background: linear-gradient(180deg, #a77b6a 0%, #835445 100%);
  border: 1px solid #6c4134;
}

/* ==========================================================================
   LEGEND COMPONENT
   ========================================================================== */
.calendar-legend-card {
  background: #ffffff;
  border: 1px solid #d8e2dc;
  border-radius: var(--radius-md, 14px);
  padding: 1.25rem 2rem;
  box-shadow: 0 4px 16px rgba(17, 42, 29, 0.05);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--neutral-800, #16241a);
}

.legend-color-box {
  width: 24px;
  height: 18px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.legend-color-box.sowing {
  background: linear-gradient(180deg, #fdc830 0%, #f39c12 100%);
  border: 1px solid #d88900;
}

.legend-color-box.growing {
  background: linear-gradient(180deg, #48bb78 0%, #2f855a 100%);
  border: 1px solid #276749;
}

.legend-color-box.harvest {
  background: linear-gradient(180deg, #a77b6a 0%, #835445 100%);
  border: 1px solid #6c4134;
}

/* Tooltip */
.cal-tooltip {
  position: absolute;
  background: #112a1d;
  color: #ffffff;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 100;
  display: none;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cal-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #112a1d transparent transparent transparent;
}

/* Agro Insights Grid */
.agro-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.agro-insight-card {
  background: #ffffff;
  border-radius: var(--radius-md, 14px);
  padding: 1.75rem;
  border: 1px solid var(--neutral-200, #e2e9e4);
  box-shadow: 0 4px 16px rgba(17, 42, 29, 0.05);
}

.agro-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-subtle, #eef5f0);
  color: var(--primary-main, #1b4332);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.1rem;
}

.agro-card-title {
  font-size: 1.15rem;
  color: var(--primary-dark, #112a1d);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.agro-card-desc {
  font-size: 0.9rem;
  color: var(--neutral-600, #465a4c);
  line-height: 1.6;
}

/* Crop Detail Modal Dialog */
.crop-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 42, 29, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal, 0.3s);
  padding: 1.5rem;
}

.crop-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.crop-modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg, 24px);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  position: relative;
  transform: translateY(20px);
  transition: transform var(--transition-normal, 0.3s);
  padding: 2.25rem;
}

.crop-modal-overlay.active .crop-modal-dialog {
  transform: translateY(0);
}

.crop-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--neutral-100, #f4f7f5);
  border: none;
  font-size: 1.1rem;
  color: var(--neutral-700, #293a2e);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast, 0.2s);
}

.crop-modal-close:hover {
  background: #e57373;
  color: #ffffff;
}

.crop-detail-header-clean {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--neutral-200, #e2e9e4);
}

.crop-detail-header-clean h3 {
  font-size: 1.5rem;
  color: var(--primary-dark, #112a1d);
  margin-bottom: 0.25rem;
}

.crop-detail-header-clean p {
  font-size: 0.95rem;
  color: var(--neutral-600, #465a4c);
}

.crop-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.crop-spec-box {
  background: var(--neutral-100, #f4f7f5);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm, 8px);
}

.crop-spec-lbl {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--neutral-500, #6b8072);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.crop-spec-val {
  font-size: 0.95rem;
  color: var(--neutral-900, #0a140e);
  font-weight: 600;
}

/* ==========================================================================
   VIEW TOGGLE & MOBILE CARDS STYLES
   ========================================================================== */
.calendar-view-toggle-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 1.5rem;
  width: 100%;
}

.calendar-view-toggle-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: #edf3ef;
  padding: 0.35rem;
  border-radius: 9999px;
  border: 1px solid #c8d9cf;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cal-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.3rem;
  border-radius: 9999px;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #293a2e !important;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  outline: none !important;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-appearance: none !important;
  appearance: none !important;
  line-height: 1.2;
}

.cal-view-btn i {
  font-size: 0.95rem;
}

.cal-view-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.8) !important;
  color: #112a1d !important;
}

.cal-view-btn.active {
  background: #1b4332 !important;
  color: #ffffff !important;
  border-color: #1b4332 !important;
  box-shadow: 0 3px 10px rgba(27, 67, 50, 0.25) !important;
}

.cal-view-btn.active i {
  color: #fdc830 !important;
}

/* Mobile Cards Container */
.calendar-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2rem;
}

.crop-mobile-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #d8e2dc;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 4px 15px rgba(17, 42, 29, 0.05);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.crop-mobile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(17, 42, 29, 0.1);
  border-color: var(--primary-light, #40916c);
}

.crop-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid #edf2ee;
  padding-bottom: 0.6rem;
}

.crop-card-name {
  font-size: 1rem;
  font-weight: 800;
  color: #112a1d;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.crop-card-category {
  font-size: 0.72rem;
  font-weight: 600;
  color: #2d6a4f;
  background: #eef5f0;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.crop-card-stages {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.crop-stage-row {
  display: flex;
  align-items: center;
  font-size: 0.84rem;
  gap: 0.5rem;
}

.crop-stage-row .stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.crop-stage-row .stage-dot.sowing {
  background: #f1b000;
}
.crop-stage-row .stage-dot.growing {
  background: #2e7d32;
}
.crop-stage-row .stage-dot.harvest {
  background: #8d5b4c;
}

.crop-stage-row .stage-label {
  font-weight: 700;
  color: #334e3e;
  min-width: 72px;
}

.crop-stage-row .stage-val {
  color: #16241a;
  font-weight: 500;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 768px) {
  /* Prevent sticky crop column from covering the screen: reduce from 200px to 86px */
  .crop-calendar-table thead th.col-crop,
  .crop-calendar-table tbody td.col-crop {
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
    padding: 0.45rem 0.25rem !important;
    text-align: center !important;
  }

  .crop-name-only {
    font-size: 0.74rem !important;
    line-height: 1.25 !important;
    text-align: center !important;
    word-break: break-word !important;
  }

  /* Reduce table min-width to 560px so scrolling is short and comfortable */
  .crop-calendar-table {
    min-width: 560px !important;
  }

  .crop-calendar-table thead th {
    padding: 0.45rem 0.15rem !important;
    font-size: 0.68rem !important;
  }

  .month-fortnights {
    font-size: 0.52rem !important;
    padding: 0 0.12rem !important;
  }

  .category-header-single-line {
    font-size: 0.76rem !important;
    gap: 0.4rem !important;
  }

  .category-header-single-line i {
    font-size: 0.9rem !important;
  }

  .tr-category-header td {
    padding: 0.5rem 0.6rem !important;
  }

  .cal-bar-layer {
    height: 17px !important;
    margin: 3px 0 !important;
  }

  .calendar-scroll-hint {
    font-size: 0.75rem !important;
  }
}

/* ==========================================================================
   PRINT STYLES - PRINTS ONLY THE CROP CALENDAR
   ========================================================================== */
@media print {
  @page {
    size: auto; /* Natural orientation: does not force landscape or distort layout */
    margin: 8mm 10mm;
  }

  /* Strict hide for all elements except the crop calendar table and legend */
  .navbar,
  .header-crop-calendar,
  .calendar-controls-bar,
  .calendar-view-toggle-bar,
  .calendar-scroll-hint,
  .page-header-breadcrumb,
  .whatsapp-float,
  .scroll-to-top,
  .agro-insights-grid,
  .crop-modal-overlay,
  .footer,
  .farmer-cta-banner,
  #pwaInstallBanner,
  .pwa-install-banner,
  #pwaIosModal,
  .pwa-ios-modal {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  body {
    background: #ffffff !important;
    font-size: 9.5pt;
    margin: 0 !important;
    padding: 0 !important;
    color: #000000 !important;
  }

  .section {
    padding: 0 !important;
  }

  .container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Print Header Banner */
  .calendar-print-only-header {
    display: block !important;
    margin-bottom: 1rem !important;
    text-align: center;
  }

  /* Dual-View Print Support: Print whichever view is currently active */
  body.view-cards-active .calendar-viewport-card {
    display: none !important;
  }

  body.view-cards-active .calendar-cards-container {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    margin-bottom: 1.5rem !important;
    page-break-inside: auto;
  }

  body.view-cards-active .crop-mobile-card {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #c4d3ca !important;
    box-shadow: none !important;
    padding: 10px 14px !important;
    background: #ffffff !important;
  }

  body.view-cards-active .crop-card-top {
    border-bottom: 1px solid #dbe6df !important;
    padding-bottom: 6px !important;
  }

  body.view-cards-active .crop-card-name {
    font-size: 10pt !important;
    font-weight: 800 !important;
    color: #112a1d !important;
  }

  body.view-cards-active .crop-card-category {
    font-size: 7.5pt !important;
    background: #eef5f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.view-cards-active .crop-stage-row {
    font-size: 8.5pt !important;
  }

  body.view-cards-active .crop-stage-row .stage-dot {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.view-timeline-active .calendar-cards-container {
    display: none !important;
  }

  body.view-timeline-active .calendar-viewport-card {
    display: block !important;
  }

  .calendar-viewport-card {
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .calendar-scrollable-container {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
  }

  .crop-calendar-table {
    min-width: 100% !important;
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
  }

  .crop-calendar-table thead th {
    background: #0d2818 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 7.5pt !important;
    padding: 5px 2px !important;
    position: static !important;
  }

  .crop-calendar-table thead th.col-crop {
    background: #071d10 !important;
    position: static !important;
    box-shadow: none !important;
    width: 16% !important;
    min-width: 16% !important;
    max-width: 16% !important;
  }

  .crop-calendar-table thead th.col-month {
    width: 7% !important;
  }

  .crop-calendar-table tbody td.col-crop {
    position: static !important;
    box-shadow: none !important;
    background: #ffffff !important;
    padding: 4px 6px !important;
    width: 16% !important;
    min-width: 16% !important;
    max-width: 16% !important;
    font-size: 8pt !important;
  }

  .crop-name-only {
    font-size: 8pt !important;
    line-height: 1.2 !important;
  }

  .tr-category-header td {
    position: static !important;
    background: #eef6f1 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 5px 8px !important;
    font-size: 8.5pt !important;
  }

  .cal-bar-layer {
    height: 14px !important;
    margin: 2px 0 !important;
  }

  .cal-bar {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .bar-sowing {
    background: #f1b000 !important;
    border-color: #d88900 !important;
  }

  .bar-growing {
    background: #2e7d32 !important;
    border-color: #1b5e20 !important;
  }

  .bar-harvest {
    background: #8d5b4c !important;
    border-color: #5d3a30 !important;
  }

  .calendar-legend-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    margin-top: 10px !important;
    padding: 6px 12px !important;
    page-break-inside: avoid;
  }
}

.calendar-print-only-header {
  display: none;
}
