:root{
  --page-bg:#f4f0ea;
  --app-bg:#ffffff;
  --header-bg:#c6ac8c;
  --menu-active:#396aab;
  --text-dark:#303947;
  --text-light:#ffffff;
  --ring:rgba(57,106,171,.45);
  --radius:12px;
  --shadow:0 12px 30px rgba(48,57,71,.12);
}

*{box-sizing:border-box;}
html{font-size:12px; scrollbar-gutter:stable;}
body{
  margin:0;
  font-family:'Quicksand',system-ui,-apple-system,Segoe UI,Arial,sans-serif;
  background:var(--page-bg);
  color:var(--text-dark);
  line-height:1.45;
}

strong{font-weight:700;}

.fw-400{font-weight:400;}
.fw-500{font-weight:500;}
.fw-600{font-weight:600;}
.fw-700{font-weight:700;}
.fw-800{font-weight:800;}
.fw-900{font-weight:900;}

a{color:inherit;text-decoration:none;}

.accent-hover:hover{
  color:var(--menu-active);
}

a:focus-visible,button:focus-visible{
  outline:3px solid var(--ring);
  outline-offset:2px;
}

.container{
  max-width:1200px;
  margin:0 auto;
  padding:12px;
}

.app-shell{
  background:var(--app-bg);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  min-height:calc(100dvh - 24px);
}

.header{
  position:sticky;
  top:0;
  z-index:50;
  background:var(--header-bg);
  color:var(--text-light);
}

.header-inner{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:140px;
}

.brand-logo{
  display:block;
  height:26px;
  width:auto;
}

.brand-title{
  font-weight:800;
  letter-spacing:.2px;
  font-size:14px;
}

.nav{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:6px;
}

.nav a{
  display:inline-flex;
  align-items:center;
  padding:8px 10px;
  border-radius:10px;
  color:var(--text-light);
  font-weight:700;
}

.nav a[aria-current="page"],
.nav a:hover{
  background:var(--menu-active);
}

.icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:12px;
  border:1px solid rgba(48,57,71,.18);
  background:#fff;
  color:var(--text-dark);
  cursor:pointer;
}

.icon-btn:disabled{
  opacity:.45;
  cursor:not-allowed;
  pointer-events:none;
}

.icon-btn:hover{background:var(--menu-active);}

.row-actions{
  display:flex;
  gap:6px;
  justify-content:flex-end;
}

.icon-action{
  width:30px;
  height:30px;
  border-radius:10px;
  font-size:16px;
  line-height:1;
}

.icon-action svg{
  width:19px;
  height:19px;
  display:block;
  stroke:currentColor;
  fill:none;
  stroke-width:2.2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.hamburger{
  display:inline-flex;
}

@media (min-width: 900px){
  .hamburger{display:none;}
}

@media (max-width: 899px){
  .nav{display:none;}
  .hamburger{margin-left:auto;}
}

.drawer-backdrop{
  position:fixed;
  inset:0;
  background:rgba(48,57,71,.45);
  display:none;
  z-index:80;
}

.drawer-backdrop[data-open="true"]{display:block;}

.drawer{
  position:fixed;
  top:0;
  right:0;
  height:100dvh;
  width:min(340px, 92vw);
  background:var(--app-bg);
  color:var(--text-dark);
  transform:translateX(100%);
  transition:transform .18s ease;
  z-index:90;
  box-shadow:0 10px 40px rgba(48,57,71,.25);
  display:flex;
  flex-direction:column;
}

.drawer[data-open="true"]{transform:translateX(0);}

.drawer-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px;
  border-bottom:1px solid rgba(48,57,71,.1);
}

.drawer-title{font-size:13px;font-weight:800;}

.drawer-nav{
  padding:10px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.drawer-nav a{
  padding:10px 10px;
  border-radius:10px;
  font-weight:800;
}

.drawer-nav a[aria-current="page"],
.drawer-nav a:hover{
  background:var(--menu-active);
  color:var(--text-light);
}

.main{
  padding:14px;
  min-width:0;
}

.main-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

.main-grid > *{
  min-width:0;
}

@media (min-width: 1000px){
  .main-grid{
    grid-template-columns: 4fr 8fr;
    align-items:start;
  }

  .main-grid.settings-grid{
    grid-template-columns: 1fr 1fr;
  }
}

.form-grid-2{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

@media (min-width: 700px){
  .form-grid-2{
    grid-template-columns:1fr 1fr;
  }
}

.page-title{
  margin:0 0 10px 0;
  font-size:15px;
  font-weight:900;
}

.toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  justify-content:space-between;
  margin:10px 0 12px;
}

.toolbar-group{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid rgba(48,57,71,.22);
  background:#fff;
  color:var(--text-dark);
  border-radius:10px;
  padding:9px 10px;
  font-weight:500;
  cursor:pointer;
  min-height:36px;
}

.btn:hover{border-color:rgba(48,57,71,.35);}

.btn.primary{
  background:var(--primary);
  border-color:var(--primary);
  color:#fff;
}

.action-btn{
  background:#ab6c59;
  border-color:#ab6c59;
  color:#FFFFFF;
}

.action-btn:hover{
  background:#386aab;
  border-color:#386aab;
  color:#FFFFFF;
}

.action-btn:focus-visible{
  outline:3px solid rgba(56,106,171,.35);
  outline-offset:2px;
}

.action-btn, .action-btn:hover, .action-btn:focus-visible {
  text-decoration: none;
}

.action-btn[aria-pressed="true"]{
  background:var(--menu-active);
  color:var(--text-light);
  border-color:transparent;
}

.calendar-card{
  background:#fff;
  border:1px solid rgba(48,57,71,.12);
  border-radius:14px;
  overflow:hidden;
  padding:10px;
  max-width:100%;
}

.card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin:-10px -10px 10px;
  padding:10px;
  background:#d6d2c5;
  border-bottom:1px solid rgba(48,57,71,.12);
}

.card-title{
  margin:0;
  font-size:13px;
  font-weight:900;
}

.breadcrumb{
  display:flex;
  align-items:center;
  gap:6px;
  margin:0 0 10px 0;
  font-size:12px;
  font-weight:900;
}

.breadcrumb a{
  text-decoration:none;
}

.breadcrumb-sep{
  opacity:.6;
}

.client-layout{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

@media (min-width: 900px){
  .client-layout{
    grid-template-columns:4fr 8fr;
    align-items:start;
  }
}

.card-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:12px;
  border:1px solid rgba(48,57,71,.18);
  background:#fff;
  color:var(--text-dark);
  cursor:pointer;
}

.card-toggle svg{
  width:18px;
  height:18px;
  display:block;
  stroke:currentColor;
  fill:none;
  stroke-width:2.2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

[data-accordion-content][hidden]{
  display:none;
}

.pagination{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-left:auto;
}

.calendar-card > .pagination{
  width:100%;
  justify-content:flex-end;
  margin-top:12px;
}

.pagination-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(48,57,71,.18);
  background:#fff;
  color:var(--text-dark);
  font-weight:500;
  text-decoration:none;
}

.pagination-btn[aria-disabled="true"]{
  opacity:.55;
  cursor:not-allowed;
  pointer-events:none;
}

.pagination span[aria-disabled="true"]{
  opacity:.55;
}

.pagination + .pagination{
  margin-top:10px;
}

.table{
  border-collapse:separate;
  border-spacing:0;
  max-width:100%;
}

.table th,
.table td{
  text-align:left;
  padding:10px;
  border-bottom:1px solid rgba(48,57,71,.12);
  white-space:nowrap;
}

.property-thumb{
  width:44px;
  height:44px;
  object-fit:cover;
  border-radius:10px;
  border:1px solid rgba(48,57,71,.12);
  background:#fff;
  display:block;
}

.property-thumb-wide{
  width:100%;
  height:160px;
}

.properties-table th:nth-child(6),
.properties-table td:nth-child(6){
  max-width:120px;
}

.property-manager-cell{
  overflow:hidden;
  text-overflow:ellipsis;
}

.table th{
  font-size:10px;
  letter-spacing:.2px;
  text-transform:uppercase;
  opacity:.85;
  text-align:center;
}

@media (max-width: 699px){
  .hide-mobile{display:none !important;}
  .show-mobile{display:inline !important;}

  .users-table,
  .clients-table{
    table-layout:fixed;
    width:100%;
  }

  .properties-table,
  .locations-table,
  .prestations-table,
  .location-tasks-table{
    table-layout:fixed;
    width:100%;
  }

  .users-table th,
  .users-table td,
  .clients-table th,
  .clients-table td{
    white-space:normal;
  }

  .users-table th:nth-child(2),
  .users-table td:nth-child(2),
  .clients-table th:nth-child(2),
  .clients-table td:nth-child(2){
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .users-table th:nth-child(7),
  .users-table td:nth-child(7),
  .clients-table th:nth-child(7),
  .clients-table td:nth-child(7){
    width:148px;
  }

  .users-table th:nth-child(1),
  .users-table td:nth-child(1),
  .users-table th:nth-child(3),
  .users-table td:nth-child(3),
  .users-table th:nth-child(4),
  .users-table td:nth-child(4),
  .users-table th:nth-child(5),
  .users-table td:nth-child(5),
  .users-table th:nth-child(6),
  .users-table td:nth-child(6),
  .clients-table th:nth-child(1),
  .clients-table td:nth-child(1),
  .clients-table th:nth-child(3),
  .clients-table td:nth-child(3),
  .clients-table th:nth-child(4),
  .clients-table td:nth-child(4),
  .clients-table th:nth-child(5),
  .clients-table td:nth-child(5),
  .clients-table th:nth-child(6),
  .clients-table td:nth-child(6){
    display:none;
  }

  .properties-table th:nth-child(3),
  .properties-table td:nth-child(3),
  .properties-table th:nth-child(5),
  .properties-table td:nth-child(5){
    display:none;
  }

  .locations-table th:nth-child(3),
  .locations-table td:nth-child(3),
  .locations-table th:nth-child(4),
  .locations-table td:nth-child(4),
  .locations-table th:nth-child(7),
  .locations-table td:nth-child(7),
  .locations-table th:nth-child(8),
  .locations-table td:nth-child(8),
  .locations-table th:nth-child(9),
  .locations-table td:nth-child(9){
    display:none;
  }

  .prestations-table th:nth-child(2),
  .prestations-table td:nth-child(2),
  .location-tasks-table th:nth-child(2),
  .location-tasks-table td:nth-child(2){
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .prestations-table th:nth-child(2),
  .prestations-table td:nth-child(2){
    max-width:70px;
    width:70px;
  }

  .location-tasks-table th:nth-child(2),
  .location-tasks-table td:nth-child(2){
    max-width:150px;
    width:150px;
  }

  .location-tasks-table th:nth-child(4),
  .location-tasks-table td:nth-child(4),
  .location-tasks-table th:nth-child(6),
  .location-tasks-table td:nth-child(6){
    display:none;
  }

  .task-grid-card{
    grid-column: span 12 !important;
  }

  .prestations-upcoming-table th:nth-child(3),
  .prestations-upcoming-table td:nth-child(3),
  .prestations-upcoming-table th:nth-child(7),
  .prestations-upcoming-table td:nth-child(7),
  .prestations-upcoming-table th:nth-child(8),
  .prestations-upcoming-table td:nth-child(8){
    display:none;
  }

  .prestations-upcoming-table th:nth-child(1),
  .prestations-upcoming-table td:nth-child(1),
  .prestations-to-bill-table th:nth-child(1),
  .prestations-to-bill-table td:nth-child(1),
  .prestations-billed-table th:nth-child(1),
  .prestations-billed-table td:nth-child(1){
    display:none;
  }

  .prestations-to-bill-table th:nth-child(3),
  .prestations-to-bill-table td:nth-child(3),
  .prestations-to-bill-table th:nth-child(8),
  .prestations-to-bill-table td:nth-child(8),
  .prestations-to-bill-table th:nth-child(9),
  .prestations-to-bill-table td:nth-child(9){
    display:none;
  }

  .prestations-billed-table th:nth-child(3),
  .prestations-billed-table td:nth-child(3),
  .prestations-billed-table th:nth-child(8),
  .prestations-billed-table td:nth-child(8),
  .prestations-billed-table th:nth-child(9),
  .prestations-billed-table td:nth-child(9){
    display:none;
  }
}

.auth-body .app-shell{
  min-height:100dvh;
  background:transparent;
  box-shadow:none;
  border-radius:0;
}

.auth-body .container{
  max-width:none;
  padding:0;
}

.auth-main{
  min-height:100dvh;
  display:flex;
  align-items:center;
  justify-content:center;
}

.auth-card{
  width:min(420px, 100%);
  background:#fff;
  border:1px solid rgba(48,57,71,.12);
  border-radius:14px;
  padding:16px;
}

.auth-form{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.field{display:flex;flex-direction:column;gap:6px;}
.field-label{font-weight:900;}

.input{
  width:100%;
  border:1px solid rgba(48,57,71,.18);
  border-radius:10px;
  padding:10px 10px;
  font:inherit;
  background:#fff;
  color:var(--text-dark);
  min-height:38px;
}

.input:focus{outline:none;}
.input:focus-visible{outline:3px solid var(--ring); outline-offset:2px;}

.notice{
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(48,57,71,.18);
}

.auth-card .notice{
  margin-bottom:10px;
}

.notice.success{
  background:#cfe1b9;
  border-color:#b5c99a;
  color:#718355;
}

.notice.error{
  background:#fbc3bc;
  border-color:#f7a399;
  color:#ef6351;
}

.muted{opacity:.85;}

.show-mobile{display:none;}

/* FullCalendar tweaks */
.fc{
  font-size:12px;
}

.fc .fc-toolbar{display:none;}

.fc .fc-scrollgrid{
  border-color:rgba(48,57,71,.12);
}

.fc .fc-daygrid-day-number,
.fc .fc-col-header-cell-cushion{
  color:var(--text-dark);
}

.fc .fc-daygrid-event,
.fc .fc-timegrid-event{
  border-radius:10px;
}

.visually-hidden{
  position:absolute !important;
  height:1px; width:1px;
  overflow:hidden;
  clip:rect(1px,1px,1px,1px);
  white-space:nowrap;
}
