:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #191b1f;
  --muted: #747b86;
  --line: #e7e9ee;
  --sidebar: #111317;
  --sidebar-muted: #8d949f;
  --accent: #191b1f;
  --green: #137c4b;
  --green-bg: #e9f8f0;
  --amber: #9b6810;
  --amber-bg: #fff6dc;
  --red: #aa3d3d;
  --red-bg: #fff0f0;
  --blue: #2f5fa7;
  --blue-bg: #eef4ff;
  --shadow: 0 1px 2px rgba(16,24,40,.04);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.sidebar {
  background: var(--sidebar);
  color: #fff;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 2px 8px 24px; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: #fff; color: #111; border-radius: 10px; font-weight: 800;
}
.brand strong, .mini-profile strong { display: block; font-size: 14px; }
.brand span, .mini-profile span { display: block; color: var(--sidebar-muted); font-size: 12px; margin-top: 2px; }
nav { display: grid; gap: 4px; }
.nav-item {
  border: 0; background: transparent; color: #b5bbc5; text-align: left;
  padding: 11px 12px; border-radius: 8px; display: flex; align-items: center; gap: 10px;
}
.nav-item:hover, .nav-item.active { background: #1d2025; color: #fff; }
.nav-item span { width: 18px; text-align: center; color: #8f96a3; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #282c33; padding-top: 16px; }
.mini-profile { display: flex; gap: 10px; align-items: center; padding: 6px 8px; }

main { min-width: 0; }
.topbar {
  height: 86px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92);
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px);
}
.topbar h1 { margin: 0; font-size: 20px; letter-spacing: -.3px; }
.topbar p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.content { padding: 26px 30px 40px; max-width: 1500px; margin: 0 auto; }
.loading-card, .empty {
  padding: 48px; text-align: center; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; color: var(--muted);
}

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 17px;
  box-shadow: var(--shadow);
}
.kpi-label { color: var(--muted); font-size: 12px; }
.kpi-value { margin-top: 10px; font-size: 24px; font-weight: 720; letter-spacing: -.7px; }
.kpi-note { margin-top: 5px; font-size: 11px; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .7fr); gap: 16px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden;
}
.panel + .panel { margin-top: 16px; }
.panel-head {
  min-height: 58px; padding: 14px 17px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 14px; }
.panel-head p { margin: 4px 0 0; font-size: 11px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th {
  font-size: 10px; color: #858b95; font-weight: 650; text-transform: uppercase; letter-spacing: .05em;
  text-align: left; padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--line);
}
td { padding: 12px 14px; border-bottom: 1px solid #f0f1f3; font-size: 12px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-cell strong { display: block; font-size: 12px; }
.person-cell span { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #eceff3; display: grid;
  place-items: center; font-size: 11px; font-weight: 700; color: #34383f; flex: 0 0 auto;
}
.avatar.small { width: 31px; height: 31px; background: #2c3037; color: #fff; }

.status, .badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 8px;
  font-size: 10px; font-weight: 650; white-space: nowrap;
}
.status.working { background: var(--green-bg); color: var(--green); }
.status.checked_out { background: #f0f1f3; color: #5c626c; }
.status.leave { background: var(--blue-bg); color: var(--blue); }
.status.not_in { background: var(--red-bg); color: var(--red); }
.status.pending { background: var(--amber-bg); color: var(--amber); }
.status.approved { background: var(--green-bg); color: var(--green); }
.status.rejected { background: var(--red-bg); color: var(--red); }
.badge { background: #f0f1f3; color: #5f6670; }
.badge.demo { background: var(--amber-bg); color: var(--amber); }
.badge.live { background: var(--green-bg); color: var(--green); }

.button {
  border: 1px solid #191b1f; background: #191b1f; color: #fff; border-radius: 8px;
  padding: 8px 11px; font-size: 11px; font-weight: 650;
}
.button:hover { opacity: .88; }
.button.secondary { background: #fff; color: var(--text); border-color: #dfe2e7; }
.button.success { background: #17764b; border-color: #17764b; }
.button.danger { background: #fff; color: var(--red); border-color: #e6c1c1; }
.button.small { padding: 6px 8px; font-size: 10px; }
.button:disabled { opacity: .5; cursor: not-allowed; }

.activity-list { padding: 6px 16px 12px; }
.activity { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f1f2f4; }
.activity:last-child { border-bottom: 0; }
.activity-text { min-width: 0; flex: 1; }
.activity-text strong { display: block; font-size: 11px; }
.activity-text span { font-size: 10px; color: var(--muted); }
.activity-time { font-size: 10px; color: var(--muted); white-space: nowrap; }

.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px;
}
.input, .select, textarea {
  background: #fff; border: 1px solid #dfe2e7; border-radius: 8px; padding: 8px 10px;
  color: var(--text); font-size: 11px; outline: none;
}
.input:focus, .select:focus, textarea:focus { border-color: #9aa2ae; }
textarea { width: 100%; min-height: 84px; resize: vertical; }

.leave-card {
  display: grid; grid-template-columns: minmax(180px,1.2fr) 1fr 1fr minmax(160px,1fr) auto;
  gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.leave-card:last-child { border-bottom: 0; }
.leave-meta strong { display: block; font-size: 12px; }
.leave-meta span, .muted { font-size: 10px; color: var(--muted); }
.leave-actions { display: flex; gap: 6px; justify-content: flex-end; }

.team-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.team-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px;
}
.team-card .avatar { width: 44px; height: 44px; margin-bottom: 14px; }
.team-card h3 { font-size: 13px; margin: 0 0 4px; }
.team-card p { font-size: 10px; color: var(--muted); margin: 0 0 14px; }
.team-stats { display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); }
.team-stats span { font-size: 10px; color: var(--muted); }
.team-stats strong { display: block; color: var(--text); margin-top: 3px; }

.snapshot-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.snapshot-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.snapshot-placeholder {
  height: 145px; background:
    linear-gradient(135deg, #f0f2f5 25%, #e7eaee 25%, #e7eaee 50%, #f0f2f5 50%, #f0f2f5 75%, #e7eaee 75%);
  background-size: 28px 28px; display: grid; place-items: center; color: #7d838d; font-size: 11px;
}
.snapshot-meta { padding: 11px 12px; display: flex; justify-content: space-between; gap: 8px; }
.snapshot-meta strong { font-size: 11px; display: block; }
.snapshot-meta span { font-size: 9px; color: var(--muted); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-row { padding: 14px 16px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.settings-row span { font-size: 11px; color: var(--muted); }
.settings-row strong { font-size: 11px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(11,13,16,.42); z-index: 20;
  display: grid; place-items: center; padding: 20px;
}
.modal-backdrop.hidden { display: none; }
.modal { width: min(480px, 100%); background: #fff; border-radius: 13px; box-shadow: 0 24px 80px rgba(0,0,0,.18); }
.modal-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 14px; }
.modal-body-inner { padding: 18px; }
.icon-button { border: 0; background: transparent; font-size: 22px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.toast {
  position: fixed; right: 20px; bottom: 20px; background: #17191d; color: #fff;
  padding: 10px 13px; border-radius: 8px; font-size: 11px; opacity: 0;
  transform: translateY(10px); transition: .2s; pointer-events: none; z-index: 30;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1150px) {
  .kpi-grid { grid-template-columns: repeat(3,1fr); }
  .team-grid, .snapshot-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; min-height: 0; }
  nav { grid-template-columns: repeat(3,1fr); }
  .sidebar-footer { display: none; }
  .grid-2, .settings-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 30px; }
  .leave-card { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  nav { grid-template-columns: repeat(2,1fr); }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .team-grid, .snapshot-grid { grid-template-columns: 1fr; }
}


/* =========================================================
   HOLIDAY CALENDAR
   ========================================================= */

.holiday-layout {
  display: grid;
  grid-template-columns:
    minmax(0, 1.8fr)
    minmax(280px, .7fr);
  gap: 16px;
}

.holiday-calendar {
  padding: 16px;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns:
    repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  border-bottom:
    1px solid var(--line);
}

.calendar-weekdays span {
  padding: 10px 4px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.calendar-day {
  position: relative;
  min-height: 105px;
  padding: 9px;
  border-right:
    1px solid var(--line);
  border-bottom:
    1px solid var(--line);
  background: #fff;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day strong {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
}

.calendar-day.empty-day {
  background: #fafbfc;
}

.calendar-day.holiday-day {
  background: #fffbf1;
}

.calendar-day.today-day strong {
  background: #191b1f;
  color: #fff;
}

.holiday-chip {
  display: block;
  margin-top: 7px;
  padding: 5px 6px;
  border-radius: 6px;
  background: #fff1c9;
  color: #8c5e08;
  font-size: 9px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.holiday-list {
  padding: 7px 16px;
}

.holiday-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom:
    1px solid var(--line);
}

.holiday-row:last-child {
  border-bottom: 0;
}

.holiday-date-box {
  width: 46px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: #fff3d6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.holiday-date-box strong {
  font-size: 15px;
  line-height: 1;
}

.holiday-date-box span {
  margin-top: 4px;
  color: #99670a;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.holiday-row-content strong {
  display: block;
  font-size: 12px;
}

.holiday-row-content span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: var(--muted);
}

@media (max-width: 950px) {
  .holiday-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .holiday-calendar {
    padding: 8px;
    overflow-x: auto;
  }

  .calendar-weekdays,
  .calendar-days {
    min-width: 650px;
  }

  .calendar-day {
    min-height: 80px;
  }
}


/* TEAM MEMBER OVERVIEW PATCH START */

.team-summary{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
  margin-bottom:16px;
}

.team-card-clickable{
  cursor:pointer;
  transition:
    border-color .15s ease,
    box-shadow .15s ease;
}

.team-card-clickable:hover{
  border-color:#cfd5dc;
  box-shadow:0 7px 20px rgba(15,23,42,.05);
}

.team-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
}

.team-view-arrow{
  color:#8d949f;
  font-size:15px;
}

.team-status-row{
  display:flex;
  gap:7px;
  align-items:center;
  flex-wrap:wrap;
  min-height:28px;
  margin-bottom:10px;
}

.team-stats-detail{
  display:grid !important;
  grid-template-columns:
    repeat(2,minmax(0,1fr));
  gap:10px 20px;
}

.team-details-button{
  width:100%;
  margin-top:13px;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  color:#25292f;
  font-size:9px;
  font-weight:700;
  cursor:pointer;
}

.team-details-button:hover{
  background:#f7f8fa;
}

.developer-detail-toolbar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:15px;
  flex-wrap:wrap;
  margin-bottom:15px;
}

.developer-range-controls{
  display:flex;
  gap:9px;
  align-items:flex-end;
  flex-wrap:wrap;
}

.developer-range-field{
  min-width:145px;
}

.developer-range-field label{
  display:block;
  margin:0 0 5px;
  color:#68717e;
  font-size:9px;
  font-weight:700;
}

.developer-profile-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  margin-bottom:15px;
  padding:17px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}

.developer-profile-main{
  display:flex;
  align-items:center;
  gap:13px;
}

.developer-profile-main .avatar{
  width:48px;
  height:48px;
}

.developer-profile-main h2{
  margin:0;
  font-size:16px;
}

.developer-profile-main p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:10px;
}

.developer-kpi-grid{
  display:grid;
  grid-template-columns:
    repeat(6,minmax(0,1fr));
  gap:12px;
  margin-bottom:15px;
}

.developer-kpi{
  min-height:106px;
  padding:15px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
}

.developer-kpi span{
  display:block;
  color:#6b7380;
  font-size:9px;
  font-weight:700;
}

.developer-kpi strong{
  display:block;
  margin-top:9px;
  font-size:21px;
  line-height:1.05;
}

.developer-kpi small{
  display:block;
  margin-top:8px;
  color:#858c96;
  font-size:8px;
  line-height:1.4;
}

.developer-detail-grid{
  display:grid;
  grid-template-columns:
    minmax(0,1.65fr)
    minmax(280px,.75fr);
  gap:15px;
  margin-bottom:15px;
}

.developer-work-bars{
  padding:7px 17px 14px;
}

.developer-work-row{
  display:grid;
  grid-template-columns:
    145px
    minmax(100px,1fr)
    62px;
  align-items:center;
  gap:12px;
  padding:11px 0;
  border-bottom:1px solid #edf0f2;
}

.developer-work-row:last-child{
  border-bottom:0;
}

.developer-work-date strong{
  display:block;
  font-size:9px;
}

.developer-work-date span{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:8px;
}

.developer-work-progress{
  height:7px;
  overflow:hidden;
  border-radius:999px;
  background:#edf0f3;
}

.developer-work-progress span{
  display:block;
  height:100%;
  border-radius:999px;
  background:#30353b;
}

.developer-work-value{
  text-align:right;
  font-size:9px;
  font-weight:700;
}

.developer-count-pill{
  display:inline-flex;
  min-width:25px;
  height:25px;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#f0f2f5;
  color:#555d68;
  font-size:9px;
  font-weight:700;
}

.developer-holiday-list{
  padding:6px 17px 14px;
}

.developer-holiday-row{
  padding:12px 0;
  border-bottom:1px solid #edf0f2;
}

.developer-holiday-row:last-child{
  border-bottom:0;
}

.developer-holiday-date{
  margin-bottom:4px;
  color:var(--muted);
  font-size:8px;
}

.developer-holiday-row strong{
  font-size:10px;
}

.developer-history-summary{
  display:flex;
  gap:7px;
}

.developer-history-summary span{
  padding:5px 8px;
  border-radius:999px;
  background:#f1f3f5;
  color:#606773;
  font-size:8px;
  font-weight:700;
}


/* Same clean calendar style used elsewhere */

.flatpickr-calendar{
  border:1px solid #e1e5ea !important;
  border-radius:13px !important;
  box-shadow:0 16px 45px rgba(15,23,42,.14) !important;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif !important;
}

.flatpickr-day{
  border-radius:8px !important;
}

.flatpickr-day.selected{
  border-color:#181b20 !important;
  background:#181b20 !important;
  color:#fff !important;
}

@media(max-width:1250px){
  .developer-kpi-grid{
    grid-template-columns:
      repeat(3,minmax(0,1fr));
  }
}

@media(max-width:900px){
  .developer-detail-grid{
    grid-template-columns:1fr;
  }
}

@media(max-width:650px){
  .developer-kpi-grid{
    grid-template-columns:
      repeat(2,minmax(0,1fr));
  }

  .developer-range-controls{
    display:grid;
    grid-template-columns:
      repeat(2,minmax(0,1fr));
    width:100%;
  }

  .developer-work-row{
    grid-template-columns:
      105px
      minmax(80px,1fr)
      55px;
  }
}

/* TEAM MEMBER OVERVIEW PATCH END */

