/* Foglio Firme — palette and layout ported from Foglio Firme.dc.html */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Work Sans", system-ui, sans-serif;
  color: #2c2621;
  background: #f2e9db;
  -webkit-font-smoothing: antialiased;
}
a { color: #a2542f; }
a:hover { color: #bc6a43; }
input, select, button { font-family: inherit; }
input:disabled, select:disabled {
  color: #2c2621; opacity: 1; -webkit-text-fill-color: #2c2621;
}

.ff-scroll::-webkit-scrollbar { height: 10px; width: 10px; }
.ff-scroll::-webkit-scrollbar-thumb { background: #d9cbb4; border-radius: 6px; }

@keyframes ffToast {
  0% { opacity: 0; transform: translate(-50%, 12px); }
  12% { opacity: 1; transform: translate(-50%, 0); }
  88% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 12px); }
}
@keyframes ffFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ff-fade { animation: ffFade 0.3s ease; }

.ff-h1 { font-family: "Bitter", serif; font-weight: 600; margin: 0; }
.ff-brand { font-family: "Bitter", serif; font-weight: 700; }

/* header */
.ff-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px; row-gap: 10px;
  padding: 12px 24px;
  background: rgba(255,253,250,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e6d8c1;
}
.ff-header-brand { display: flex; align-items: center; gap: 11px; }
.ff-header-right {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px; row-gap: 8px;
  margin-left: auto;
}
.ff-header-divider { width: 1px; height: 26px; background: #e6d8c1; flex: none; }
.ff-header-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.ff-hamburger {
  display: none; width: 34px; height: 34px; flex: none;
  align-items: center; justify-content: center;
  border: 1px solid #e6d8c1; background: #fffdfa; border-radius: 9px;
  color: #6b5f52; font-size: 16px; cursor: pointer;
}
.ff-hamburger:hover { border-color: #bc6a43; color: #bc6a43; }
.ff-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: #bc6a43; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: "Bitter", serif; font-weight: 700; font-size: 17px;
}
.ff-avatar {
  border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
}
.ff-month-nav {
  display: flex; align-items: center; gap: 4px;
  background: #f2e9db; border: 1px solid #e6d8c1; border-radius: 10px; padding: 3px;
}
.ff-month-nav button {
  width: 28px; height: 28px; border: none; background: transparent;
  border-radius: 7px; cursor: pointer; color: #8a6a4a; font-size: 16px;
}
.ff-month-nav button:hover { background: #e6d8c1; }
.ff-month-label {
  font-weight: 600; font-size: 13.5px; min-width: 118px; text-align: center; text-transform: capitalize;
}

.ff-iconbtn {
  width: 32px; height: 32px; border: 1px solid #e6d8c1; background: #fffdfa;
  border-radius: 9px; cursor: pointer; color: #8f8577; font-size: 14px;
}
.ff-iconbtn:hover { border-color: #bc6a43; color: #bc6a43; }

/* cards */
.ff-card {
  background: #fffdfa; border: 1px solid #e6d8c1; border-radius: 16px;
}
.ff-stat {
  text-align: center; padding: 8px 16px; background: #fffdfa;
  border: 1px solid #e6d8c1; border-radius: 12px;
}
.ff-stat-value { font-family: "Bitter", serif; font-size: 20px; font-weight: 600; }
.ff-stat-label { font-size: 10.5px; color: #8f8577; text-transform: uppercase; letter-spacing: 0.04em; }

/* list */
.ff-list-head {
  display: grid; grid-template-columns: 2fr 1fr 1.1fr 1.6fr auto; gap: 12px;
  padding: 12px 20px; background: #f7f0e5; border-bottom: 1px solid #e6d8c1;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #a39685;
}
.ff-list-row {
  display: grid; grid-template-columns: 2fr 1fr 1.1fr 1.6fr auto; gap: 12px;
  align-items: center; padding: 14px 20px; border-bottom: 1px solid #f0e7d8;
  text-decoration: none; color: inherit;
}
.ff-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.ff-pill-dot { width: 7px; height: 7px; border-radius: 50%; }
.ff-cta {
  padding: 8px 16px; border-radius: 9px; border: 1px solid; font-weight: 600;
  font-size: 12.5px; cursor: pointer; white-space: nowrap; text-decoration: none;
  display: inline-block;
}

/* small dropdown menu (export format choice, etc.) */
.ff-export-menu {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 6px;
  flex-direction: column; gap: 2px; min-width: 170px;
  background: #fffdfa; border: 1px solid #e6d8c1; border-radius: 10px; padding: 6px;
  box-shadow: 0 14px 34px rgba(44,38,33,0.16); z-index: 30;
}
.ff-export-menu.ff-open { display: flex; }
.ff-export-menu a {
  padding: 9px 12px; border-radius: 7px; font-size: 13px; color: #3a332c; text-decoration: none;
}
.ff-export-menu a:hover { background: #f7f0e5; }

/* sheet layout (day table + sidebar) */
.ff-sheet-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 22px; align-items: start;
}
.ff-sheet-sidebar { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }

/* sheet grid */
.ff-grid-head {
  display: grid; grid-template-columns: 118px minmax(300px, 1fr) 92px 210px; gap: 0;
  background: #f7f0e5; border-bottom: 1px solid #e6d8c1;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #a39685;
}
.ff-grid-head > span { padding: 11px 14px; }
.ff-grid-head > span + span { border-left: 1px solid #ece1cf; }

.ff-row {
  display: grid; grid-template-columns: 118px minmax(300px, 1fr) 92px 210px; gap: 0;
  border-bottom: 1px solid #f2ebdd;
}
.ff-row-day { padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; }
.ff-row-turni {
  padding: 8px 14px; border-left: 1px solid #f2ebdd;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 52px;
}
.ff-row-ore {
  padding: 10px 14px; border-left: 1px solid #f2ebdd;
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
}
.ff-row-giust {
  padding: 8px 14px; border-left: 1px solid #f2ebdd; display: flex; align-items: center; gap: 8px;
}

.ff-turno {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 4px;
  background: #fffdfa; border: 1px solid #e6d8c1; border-radius: 9px;
}
.ff-time-select {
  width: 80px; border: none; background: transparent; font-size: 13px;
  padding: 3px 2px; color: #2c2621; outline: none; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.ff-progetto-select {
  max-width: 130px; border: none; border-left: 1px solid #e9dfd0; background: transparent;
  font-size: 12px; padding: 3px 4px 3px 8px; margin-left: 2px; color: #8a6a4a; outline: none;
  cursor: pointer; text-overflow: ellipsis;
}
.ff-turno-arrow { color: #c3b49c; font-size: 12px; }
.ff-turno-remove {
  border: none; background: transparent; color: #c9a58f; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 3px;
}
.ff-turno-remove:hover { color: #bc6a43; }
.ff-turno-add {
  width: 26px; height: 26px; border: 1px dashed #d9c7ac; background: transparent;
  border-radius: 8px; color: #a3745a; cursor: pointer; font-size: 15px; line-height: 1;
}
.ff-turno-add:hover { border-color: #bc6a43; color: #bc6a43; background: #fdf6ee; }

.ff-giust-select {
  flex: 1; min-width: 0; border: 1px solid #e6d8c1; background: #fffdfa;
  border-radius: 8px; padding: 7px 8px; font-size: 12.5px; color: #2c2621; cursor: pointer; outline: none;
}
.ff-gh {
  width: 46px; border: 1px solid #e6d8c1; background: #fffdfa; border-radius: 8px;
  padding: 6px 5px; font-size: 12.5px; text-align: center; color: #2c2621; outline: none;
}

/* sidebar */
.ff-sidebar-hero { background: #bc6a43; color: #fff5ec; border-radius: 16px; padding: 20px; }
.ff-sidebar-hero .value {
  font-family: "Bitter", serif; font-size: 34px; font-weight: 700; margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.ff-btn {
  padding: 11px 20px; border-radius: 11px; border: 1px solid; font-weight: 600;
  font-size: 13.5px; cursor: pointer;
}

/* trail */
.ff-trail-dot {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fffdfa;
}
.ff-trail-line { width: 2px; flex: 1; background: #eee2d1; margin-top: 2px; }

/* toast */
.ff-toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 50; transform: translateX(-50%);
  background: #2c2621; color: #fff5ec; padding: 12px 22px; border-radius: 12px;
  font-size: 13.5px; font-weight: 500; box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  animation: ffToast 2.6s ease forwards;
}

/* login screen */
.ff-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px;
  background: radial-gradient(120% 120% at 15% 0%, #f6efe1 0%, #ece0cd 55%, #e6d8c1 100%);
}
.ff-login-card {
  width: 100%; max-width: 940px; min-width: 0; display: grid; grid-template-columns: 1.1fr 0.9fr;
  border-radius: 22px; overflow: hidden; box-shadow: 0 24px 70px rgba(70,45,20,0.18);
  border: 1px solid #e6d8c1; background: #fffdfa;
}
.ff-login-brand {
  padding: 52px 48px; min-width: 0; background: linear-gradient(160deg, #bc6a43 0%, #9a4f2c 100%);
  color: #fff5ec; display: flex; flex-direction: column; gap: 26px;
}
.ff-login-form { padding: 52px 44px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ff-google-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 13px 15px; border: 1px solid #e9dfd0; background: #fffdfa; border-radius: 13px;
  cursor: pointer; text-decoration: none; color: inherit;
}
.ff-google-btn:hover { border-color: #bc6a43; background: #fdf6ee; }

/* paired form fields — wrapped so they can stack on narrow screens */
.ff-field-row { display: flex; gap: 12px; }

@media (max-width: 760px) {
  .ff-login-wrap { padding: 16px; }
  .ff-login-card { grid-template-columns: 1fr; }
  .ff-login-brand { padding: 32px 26px; gap: 20px; }
  .ff-login-form { padding: 32px 26px; }
}

@media (max-width: 860px) {
  .ff-sheet-layout { grid-template-columns: 1fr; }
  .ff-sheet-sidebar { position: static; }
}

@media (max-width: 720px) {
  .ff-header { padding: 10px 14px; }
  .ff-header-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .ff-header-divider { display: none; }
  .ff-field-row { flex-wrap: wrap; }

  .ff-hamburger { display: flex; }
  .ff-header-nav {
    display: none;
    position: absolute; top: 100%; right: 14px; margin-top: 8px;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fffdfa; border: 1px solid #e6d8c1; border-radius: 12px;
    padding: 8px; min-width: 190px; box-shadow: 0 14px 34px rgba(44,38,33,0.16);
    z-index: 30;
  }
  .ff-header-nav.ff-open { display: flex; }
  .ff-header-nav a { padding: 10px 12px; border-radius: 8px; }
  .ff-header-nav a:hover { background: #f7f0e5; }
}
