/* ===============================
   GLOBAL VARIABLES & ROOT
================================*/
:root {
  --brand-green: #10b981;
  --brand-green-hover: #059669;
  --brand-active-bg: #d1e7dd;
  --brand-active-border: #a3cfbb;
  --brand-active-text: #065f46;
  --primary-blue: #10b981;
  --border-color: #e2e8f0;
  --bg-muted: #f8faf9;
}

/* ===============================
   GLOBAL LAYOUT & BACKGROUND
================================*/
html, body {
    height: 100dvh;
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background-color: #f8faf9;
    background-image: linear-gradient(rgba(248, 250, 249, 0.92), rgba(248, 250, 249, 0.92)), url("../img/BG_v1.png");
    background-repeat: repeat;
    background-size: 150px 150px;
    overflow-x: hidden;
    color: #2d3748;
}

.content { 
    padding: 0.5rem 1rem; 
    transition: margin-left 0.3s ease; 
}

.Mobheader {
    display: none;
}

/* ===============================
   SIDEBAR NAVIGATION
================================*/
.sidebar {
    width: 220px;
    height: calc(100dvh - 60px);
    position: fixed;
    top: 50px;
    left: 0;
    overflow-y: auto;
    display: none;
    z-index: 1200;
}

.sidebar a {
    display: flex;
    align-items: center;
    color: white;
    padding: 0.75rem 1rem;
    text-decoration: none;
    margin-bottom: 0.25rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

/* ===============================
   GREEN & WHITE BRAND CONTROLS
================================*/
.bg-success-custom {
    background-color: var(--brand-green) !important;
}

.btn-success {
    background-color: var(--brand-green) !important;
    border-color: var(--brand-green) !important;
    color: #ffffff !important;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn-success:hover, .btn-success:focus {
    background-color: var(--brand-green-hover) !important;
    border-color: var(--brand-green-hover) !important;
    color: #ffffff !important;
}

.btn-active {
    background-color: var(--brand-active-bg) !important;
    border-color: var(--brand-active-border) !important;
    color: var(--brand-active-text) !important;
    font-weight: 600 !important;
}

.btn-outline-success {
    color: #059669 !important;
    border-color: #a7f3d0 !important;
    background-color: #ffffff !important;
}

.btn-outline-success:hover, .btn-outline-success.active {
    background-color: #10b981 !important;
    color: #ffffff !important;
    border-color: #10b981 !important;
}

.text-success {
    color: #059669 !important;
}

.profile-trigger {
    transition: background-color 0.2s ease;
}

.profile-trigger:hover {
    background-color: rgba(16, 185, 129, 0.08);
}

.dropdown-menu-custom {
    border: none !important;
    box-shadow: 0 0.75rem 1.5rem rgba(16, 185, 129, 0.12) !important;
}

/* ===============================
   CENTER CONTENT WRAPPER (COMPACT)
================================*/
.MobMenu {
    margin-left: 0;
    padding: 5px 15px !important;
    position: relative;
    z-index: 1600;
}

.menu-wrapper {
    width: 95% !important;
    max-width: 1400px;
    margin: auto;
    position: relative;
}

/* ===============================
   DESKTOP FLOATING SIDE PANEL
================================*/
.panel {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.12);
    display: none;
    z-index: 2000;
    overflow: hidden;
}

.panel.show {
    display: block;
}

/* ===============================
   MOBILE BOTTOM DRAWER SHEET
================================*/
.mobile-panel {
    display: none;
    position: fixed;
    bottom: 65px; 
    left: 0;
    width: 100%;
    background: white;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 20px rgba(16, 185, 129, 0.12);
    z-index: 2000;
    overflow: hidden;
}

.mobile-panel.show {
    display: block; 
}

/* ===============================
   LOGIN CARD
================================*/
.modlogin {
    width: 420px;
    border-radius: 16px;
    backdrop-filter: blur(8px);
}

.modlogin.card {
    border: none;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.12);
    background: rgba(255, 255, 255, 0.85) !important;
}

.upperlogo {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

/* ===============================
   CALENDAR DESKTOP VIEW STYLES
================================*/
@media (min-width: 768px) {
  html, body {
 height: calc(100dvh - 100px);
    max-height: 100dvh;
    overflow: hidden !important;
  }
  
  .calendar-container {
    width: 100% !important;
    max-width: 1450px !important;
    height: calc(100dvh - 65px) !important;
    margin: 0 auto !important;
    padding: 0.2rem 0.5rem 0 0.5rem !important;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden !important;
  }

  .calendar-card {
    flex: 1 !important;
    width: 100% !important;
    height: 650px !important;
    max-height: 650px !important;
    margin: 0 auto !important;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
    overflow: hidden !important;
  }

  .calendar-card > .card-header {
    flex-shrink: 0 !important;
    padding: 0.35rem 0.8rem !important;
  }

  .calendar-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  .calendar-grid {
    flex-shrink: 0;
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    width: 100% !important;
  }

  #desktop-calendar-grid {
    display: grid !important;
    flex-grow: 1 !important;
    grid-template-columns: repeat(7, 1fr) !important;
    grid-template-rows: repeat(6, 1fr) !important; 
    border-top: 1px solid var(--border-color);
    height: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
  }

  .calendar-day-header {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: #4a5568;
    padding: 4px 0;
    text-align: center;
    background-color: var(--bg-muted);
    border-bottom: 1px solid var(--border-color);
  }

  #desktop-calendar-grid > div,
  .calendar-day {
    border-right: 1px solid var(--border-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
    transition: background-color 0.2s ease;
    cursor: pointer;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    background-color: #fff !important;
    position: relative !important;
    padding: 1px 3px !important;
    height: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .calendar-day:nth-child(7n+1) {
    border-left: 1px solid var(--border-color);
  }

  .calendar-day:hover {
    background-color: var(--bg-muted);
  }

  .calendar-day.different-month {
    background-color: #fafbfb;
    color: #cbd5e1;
  }

  .calendar-day.today {
    background-color: #ecfdf5;
  }

  .calendar-day.today .day-number {
    background-color: var(--brand-green);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.7rem;
  }

  .day-number {
    font-weight: 600;
    font-size: 0.75rem;
  }

  .day-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
  }

  .desktop-day-attendance-btn {
    padding: 0px 2px;
    font-size: 0.5rem;
    font-weight: 500;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 1px;
    transition: all 0.2s;
    border: 1px solid var(--brand-green);
    background: transparent;
    color: var(--brand-green);
  }

  .desktop-day-attendance-btn:hover {
    background: var(--brand-green);
    color: white;
  }

  .event-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 1px;
    overflow: hidden;
    flex-grow: 1;
  }
}

/* ===============================
   CALENDAR MOBILE VIEW STYLES
================================*/
@media (max-width: 767.98px) {
  .content { 
    padding: 0; 
    transition: margin-left 0.3s ease; 
  }

  .MobMenu {
    display: none;
  }

  .Mobheader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 1100;
  }

  .sidebar {
    top: auto;
    bottom: 0;
    width: 100%;
    height: 65px;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    z-index: 1200;
    background-color: #ffffff;
  }

  .sidebar button, .sidebar a {
    flex: 1;
    height: 100%;
    border: none;
    border-radius: 0;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body {
    background-color: #ffffff;
    overflow-y: auto;
  }

  .mobile-app-wrapper {
    position: relative;
    width: 100%;
    min-height: calc(100dvh - 65px);
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    padding-top: 395px; 
    padding-bottom: 90px;
  }

  .mobile-calendar-sticky-header {
    position: fixed !important;
    top: 55px !important; 
    left: 0 !important;
    width: 100% !important;
    background-color: #ffffff !important;
    z-index: 1050 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.06);
  }

  .mobile-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex-shrink: 0;
  }

  .mobile-day-header {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #4a5568;
    padding: 4px 0;
    text-align: center;
    flex-shrink: 0;
  }

  .mobile-day {
    height: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    border-radius: 8px;
    margin: 2px;
    transition: all 0.2s ease;
  }

  .mobile-day.different-month {
    color: #cbd5e1;
  }

  .mobile-day.selected-day {
    background-color: var(--brand-green) !important;
    color: #ffffff !important;
    font-weight: bold;
  }

  .mobile-day.today:not(.selected-day) {
    border: 2px solid var(--brand-green);
    font-weight: bold;
  }

  .day-focus-container {
    background-color: var(--bg-muted);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 16px 16px 0 16px;
    box-shadow: inset 0 4px 6px rgba(0,0,0,0.02);
    min-height: 300px;
  }

  #mobile-selected-day-label {
    margin-bottom: 12px;
  }

  #mobile-events-list {
    overflow-y: visible !important;
    padding-bottom: 20px;
  }

  .event-card {
    background: #ffffff;
    border-left: 4px solid var(--brand-green);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.04);
  }

  .empty-state {
    color: #64748b;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .fab-container {
    position: fixed;
    bottom: 80px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1300;
  }

  .fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  }

  .fab-proof-btn {
    height: 48px;
    padding: 0 18px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  }
}

/* ===============================
   SHARED CALENDAR COMPONENTS
================================*/
.calendar-event-pill {
  font-size: 0.68rem;
  padding: 2px 4px;
  background-color: #ecfdf5;
  color: var(--brand-green);
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #a7f3d0;
  font-weight: 500;
}

.event-dot {
  width: 5px;
  height: 5px;
  background-color: var(--brand-green);
  border-radius: 50%;
  position: absolute;
  bottom: 4px;
}

.mobile-day.selected-day .event-dot {
  background-color: #ffffff;
}

@media (max-width: 480px) {
    .modlogin {
        width: 95%;
        margin: 10px;
    }
}

/* ===============================
   MODALS & OVERLAYS TOP LAYER FIX
================================*/
.modal-backdrop {
    z-index: 2900 !important;
}

.modal {
    z-index: 3000 !important;
}

/* ===============================
   IMAGE SIZE CONSTRAINTS
================================*/
.app-logo-img {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    object-fit: cover !important;
}

.profile-avatar-sm {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    object-fit: cover !important;
}

.profile-avatar-sm-md {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    object-fit: cover !important;
}

.profile-avatar-md {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    object-fit: cover !important;
}

.profile-avatar-lg {
    width: 90px !important;
    height: 90px !important;
    min-width: 90px !important;
    min-height: 90px !important;
    object-fit: cover !important;
}

/* ===============================
   COMPACT DASHBOARD OVERRIDES
================================*/
.container-fluid.py-3 {
    padding-top: 0.15rem !important;
    padding-bottom: 0.5rem !important;
}

.row.g-3 {
    --bs-gutter-y: 0.4rem !important;
    --bs-gutter-x: 0.4rem !important;
}

.mb-3 {
    margin-bottom: 0.4rem !important;
}

.mb-2 {
    margin-bottom: 0.25rem !important;
}

.mb-4 {
    margin-bottom: 0.5rem !important;
}

.card-body {
    padding: 0.5rem !important;
}

.card-header {
    padding: 0.3rem 0.5rem !important;
}

.card-body .d-flex.mb-2 {
    margin-bottom: 0.2rem !important;
}