/* =========================================================
   Rabbit Workspace OS v120 — Timbrature
   Responsive, neumorphic and touch-friendly attendance module.
   ========================================================= */
#attendance.view.active{display:block!important;min-width:0!important}
.rat-page{width:100%;max-width:1480px;margin:0 auto;padding:22px clamp(18px,2.2vw,34px) 52px;display:grid;gap:18px;color:var(--neo-text,#26313c)}
.rat-page *{box-sizing:border-box}
.rat-notice,.rat-alert{padding:12px 15px;border-radius:15px;font-size:12px;font-weight:850;line-height:1.4}
.rat-notice{background:#e9fbf4;color:#167552;border:1px solid #c8efde}
.rat-alert{background:#fff1f3;color:#a92d43;border:1px solid #ffd1d9}

.rat-hero{position:relative;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(330px,.72fr);gap:18px;padding:26px;border-radius:30px;background:var(--neo-surface,#e8edf3);box-shadow:12px 12px 26px var(--neo-shadow-dark,#c5ccd4),-12px -12px 26px var(--neo-shadow-light,#fff);overflow:hidden}
.rat-hero:before{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(circle at 10% 0%,rgba(108,124,255,.13),transparent 38%),radial-gradient(circle at 100% 100%,rgba(82,201,149,.12),transparent 34%)}
.rat-hero-copy,.rat-punch-card,.rat-hero-stats{position:relative;z-index:1}
.rat-kicker{display:inline-flex;padding:7px 11px;border-radius:999px;background:rgba(255,255,255,.55);box-shadow:inset 2px 2px 5px rgba(197,204,212,.72),inset -2px -2px 5px #fff;color:#5363da;font-size:9px;font-weight:950;letter-spacing:.08em;text-transform:uppercase}
.rat-hero h1{margin:17px 0 9px;font-size:clamp(34px,4vw,58px);line-height:.96;letter-spacing:-.065em;color:#24303d}
.rat-hero p{max-width:690px;margin:0;color:#687786;font-size:13px;line-height:1.5;font-weight:720}
.rat-live-clock{display:flex;align-items:flex-end;gap:11px;margin-top:26px}
.rat-live-clock b{font-size:clamp(31px,3vw,44px);line-height:1;color:#26313c;letter-spacing:-.05em;font-variant-numeric:tabular-nums}
.rat-live-clock small{padding-bottom:4px;color:#7f8b96;font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:.04em}

.rat-punch-card{align-self:stretch;padding:18px;border-radius:24px;background:var(--neo-surface,#e8edf3);box-shadow:inset 5px 5px 11px var(--neo-shadow-dark,#c5ccd4),inset -5px -5px 11px var(--neo-shadow-light,#fff);display:flex;flex-direction:column;gap:13px}
.rat-status-line{display:grid;grid-template-columns:13px minmax(0,1fr);gap:10px;align-items:center}
.rat-status-line>span{width:11px;height:11px;border-radius:50%;background:#9ba7b2;box-shadow:0 0 0 5px rgba(127,139,150,.12)}
.rat-hero.is-in .rat-status-line>span{background:#42be87;box-shadow:0 0 0 5px rgba(82,201,149,.16)}
.rat-status-line b{display:block;color:#26313c;font-size:13px}
.rat-status-line small{display:block;margin-top:2px;color:#7f8b96;font-size:9.5px;font-weight:750}
.rat-note{display:grid;gap:6px}
.rat-note span,.rat-filters label span{color:#6d7b88;font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.055em}
.rat-note input,.rat-filters input,.rat-filters select{width:100%;height:42px;padding:0 13px;border:1px solid transparent;border-radius:14px;background:var(--neo-surface,#e8edf3);color:#26313c;box-shadow:inset 4px 4px 8px var(--neo-shadow-dark,#c5ccd4),inset -4px -4px 8px var(--neo-shadow-light,#fff);font-size:12px;font-weight:760;outline:none}
.rat-note input:focus,.rat-filters input:focus,.rat-filters select:focus{border-color:rgba(108,124,255,.45);box-shadow:inset 4px 4px 8px var(--neo-shadow-dark,#c5ccd4),inset -4px -4px 8px var(--neo-shadow-light,#fff),0 0 0 3px rgba(108,124,255,.15)}
.rat-punch-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.rat-punch-actions button{min-height:54px;border:0;border-radius:17px;display:flex;align-items:center;justify-content:center;gap:8px;font-weight:950;font-size:11px;cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,filter .16s ease}
.rat-punch-actions button span{font-size:17px}
.rat-punch-actions .rat-in{background:linear-gradient(135deg,#52c995,#30a975);color:#fff;box-shadow:6px 6px 12px #b8c2c9,-6px -6px 12px #fff}
.rat-punch-actions .rat-out{background:linear-gradient(135deg,#ef7181,#d8586b);color:#fff;box-shadow:6px 6px 12px #b8c2c9,-6px -6px 12px #fff}
.rat-punch-actions button:hover:not(:disabled){transform:translateY(-1px);filter:saturate(1.05)}
.rat-punch-actions button:active:not(:disabled){transform:none;box-shadow:inset 4px 4px 8px rgba(0,0,0,.16),inset -4px -4px 8px rgba(255,255,255,.13)}
.rat-punch-actions button:disabled{opacity:.42;cursor:not-allowed;filter:grayscale(.15);box-shadow:none}
.rat-server-note{color:#84909b;font-size:8.5px;line-height:1.35;font-weight:740;text-align:center}

.rat-hero-stats{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}
.rat-hero-stats article,.rat-team-summary article{padding:15px 16px;border-radius:19px;background:var(--neo-surface,#e8edf3);box-shadow:6px 6px 13px var(--neo-shadow-dark,#c5ccd4),-6px -6px 13px var(--neo-shadow-light,#fff)}
.rat-hero-stats span,.rat-team-summary span{display:block;color:#7f8b96;font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.055em}
.rat-hero-stats b,.rat-team-summary b{display:block;margin-top:6px;color:#26313c;font-size:23px;line-height:1;letter-spacing:-.045em}
.rat-hero-stats small,.rat-team-summary small{display:block;margin-top:5px;color:#84909b;font-size:9px;font-weight:720}

.rat-toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;padding:14px 15px;border-radius:22px;background:var(--neo-surface,#e8edf3);box-shadow:7px 7px 15px var(--neo-shadow-dark,#c5ccd4),-7px -7px 15px var(--neo-shadow-light,#fff)}
.rat-tabs{display:flex;gap:7px;flex:0 0 auto}
.rat-tabs button,.rat-filters>button{min-height:40px;padding:0 14px;border:0;border-radius:14px;background:var(--neo-surface,#e8edf3);color:#536170;box-shadow:5px 5px 10px var(--neo-shadow-dark,#c5ccd4),-5px -5px 10px var(--neo-shadow-light,#fff);font-size:10px;font-weight:900;cursor:pointer}
.rat-tabs button.active{color:#5c6deb;box-shadow:inset 4px 4px 8px var(--neo-shadow-dark,#c5ccd4),inset -4px -4px 8px var(--neo-shadow-light,#fff)}
.rat-filters{display:flex;align-items:flex-end;justify-content:flex-end;gap:9px;flex-wrap:wrap}
.rat-filters label{display:grid;gap:5px;min-width:132px}
.rat-filters .rat-user-filter{min-width:230px}
.rat-filters>button:hover,.rat-tabs button:hover{color:#5c6deb;transform:translateY(-1px)}
.rat-filters .rat-refresh{color:#5363da}

.rat-panel{padding:20px;border-radius:27px;background:var(--neo-surface,#e8edf3);box-shadow:9px 9px 20px var(--neo-shadow-dark,#c5ccd4),-9px -9px 20px var(--neo-shadow-light,#fff)}
.rat-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:16px}
.rat-panel-head span{color:#6c7cff;font-size:9px;font-weight:950;text-transform:uppercase;letter-spacing:.07em}
.rat-panel-head h2{margin:5px 0 3px;color:#26313c;font-size:25px;line-height:1;letter-spacing:-.05em}
.rat-panel-head p{margin:0;color:#7f8b96;font-size:10px;font-weight:720}
.rat-panel-head em{padding:7px 10px;border-radius:999px;background:var(--neo-surface,#e8edf3);box-shadow:inset 3px 3px 6px var(--neo-shadow-dark,#c5ccd4),inset -3px -3px 6px var(--neo-shadow-light,#fff);color:#63707c;font-size:9px;font-style:normal;font-weight:900;white-space:nowrap}
.rat-history{display:grid;gap:11px}
.rat-day{padding:14px;border-radius:20px;background:var(--neo-surface,#e8edf3);box-shadow:inset 3px 3px 7px rgba(197,204,212,.72),inset -3px -3px 7px rgba(255,255,255,.92)}
.rat-day header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 2px 10px}
.rat-day header b{display:block;color:#26313c;font-size:12px;text-transform:capitalize}
.rat-day header small{display:block;margin-top:2px;color:#87939e;font-size:8.5px;font-weight:760}
.rat-day header strong{color:#5363da;font-size:17px;letter-spacing:-.04em}
.rat-shifts{display:grid;gap:7px}
.rat-shift{display:grid;grid-template-columns:70px 18px 70px 82px minmax(0,1fr);align-items:center;gap:8px;min-height:40px;padding:7px 10px;border-radius:14px;background:rgba(255,255,255,.48);border:1px solid rgba(255,255,255,.55);color:#596674;font-size:10px;font-weight:820}
.rat-shift i{color:#9aa5af;font-style:normal;text-align:center}
.rat-shift b{color:#26313c;text-align:right;font-variant-numeric:tabular-nums}
.rat-shift small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#7d8995}
.rat-shift.open{border-color:rgba(82,201,149,.45);background:rgba(233,251,244,.7)}
.rat-shift.open>span:nth-of-type(2){color:#16825b;font-weight:950}
.rat-empty,.rat-loading,.rat-error{min-height:320px;padding:40px;border-radius:27px;background:var(--neo-surface,#e8edf3);box-shadow:inset 6px 6px 13px var(--neo-shadow-dark,#c5ccd4),inset -6px -6px 13px var(--neo-shadow-light,#fff);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#71808e}
.rat-empty span,.rat-error>span{width:56px;height:56px;border-radius:18px;display:grid;place-items:center;margin-bottom:12px;background:var(--neo-surface,#e8edf3);box-shadow:6px 6px 12px var(--neo-shadow-dark,#c5ccd4),-6px -6px 12px var(--neo-shadow-light,#fff);font-size:24px;color:#6c7cff}
.rat-empty b,.rat-loading h2,.rat-error h2{color:#26313c;font-size:18px}
.rat-empty small,.rat-loading p,.rat-error p,.rat-error small{margin-top:5px;max-width:520px;color:#7f8b96;font-size:10px;line-height:1.45;font-weight:730}
.rat-error button{margin:15px 0 8px;min-height:42px;padding:0 18px;border:0;border-radius:14px;background:#6c7cff;color:#fff;font-weight:900;cursor:pointer}
.rat-loading>span{width:42px;height:42px;border:4px solid rgba(108,124,255,.16);border-top-color:#6c7cff;border-radius:50%;animation:ratSpin .8s linear infinite}
@keyframes ratSpin{to{transform:rotate(360deg)}}

.rat-team-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.rat-team-table-wrap{overflow:auto;border-radius:19px;box-shadow:inset 4px 4px 9px var(--neo-shadow-dark,#c5ccd4),inset -4px -4px 9px var(--neo-shadow-light,#fff)}
.rat-team-table{width:100%;min-width:850px;border-collapse:separate;border-spacing:0;color:#52606d;font-size:10px}
.rat-team-table th{position:sticky;top:0;z-index:2;padding:12px;text-align:left;background:#dfe5eb;color:#6c7783;font-size:8.5px;text-transform:uppercase;letter-spacing:.055em}
.rat-team-table td{padding:11px 12px;border-top:1px solid rgba(197,204,212,.55);background:rgba(232,237,243,.6)}
.rat-team-table tbody tr:hover td{background:rgba(243,246,249,.82)}
.rat-person{display:grid;grid-template-columns:34px minmax(0,1fr);align-items:center;gap:8px}
.rat-person>span{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(135deg,#dce4ff,#d9f5ec);color:#5363da;font-weight:950}
.rat-person b{display:block;color:#26313c;font-size:10px}
.rat-person small{display:block;margin-top:2px;color:#87939e;font-size:8.5px}
.rat-presence{display:inline-flex;padding:6px 9px;border-radius:999px;font-size:8.5px;font-weight:900}
.rat-presence.online{background:#dcf7ea;color:#157453}
.rat-presence.offline{background:#e1e6eb;color:#71808d}

@media(max-width:1180px){
  .rat-page{padding:17px 16px 42px}
  .rat-hero{grid-template-columns:1fr minmax(300px,.8fr)}
  .rat-toolbar{align-items:stretch;flex-direction:column}
  .rat-filters{justify-content:flex-start}
}
@media(max-width:820px){
  .rat-page{padding:14px 12px 110px;gap:14px}
  .rat-hero{grid-template-columns:1fr;padding:18px;border-radius:24px}
  .rat-hero h1{font-size:clamp(34px,10vw,48px)}
  .rat-live-clock{margin-top:18px}
  .rat-punch-card{border-radius:20px}
  .rat-hero-stats,.rat-team-summary{grid-template-columns:1fr 1fr}
  .rat-hero-stats article:last-child,.rat-team-summary article:last-child{grid-column:1/-1}
  .rat-toolbar{padding:12px;border-radius:19px}
  .rat-tabs{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .rat-tabs button:only-child{grid-column:1/-1}
  .rat-filters{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .rat-filters label,.rat-filters .rat-user-filter{min-width:0;width:100%}
  .rat-filters .rat-user-filter{grid-column:1/-1}
  .rat-filters>button{width:100%}
  .rat-panel{padding:15px;border-radius:23px}
  .rat-panel-head h2{font-size:22px}
  .rat-shift{grid-template-columns:58px 16px 58px 70px;gap:5px}
  .rat-shift small{grid-column:1/-1;white-space:normal;padding-top:3px}
}
@media(max-width:520px){
  .rat-page{padding-left:10px;padding-right:10px}
  .rat-hero{padding:15px;border-radius:22px;box-shadow:7px 7px 16px var(--neo-shadow-dark,#c5ccd4),-7px -7px 16px var(--neo-shadow-light,#fff)}
  .rat-hero p{font-size:12px}
  .rat-punch-actions{grid-template-columns:1fr}
  .rat-punch-actions button{min-height:56px}
  .rat-hero-stats,.rat-team-summary{grid-template-columns:1fr}
  .rat-hero-stats article:last-child,.rat-team-summary article:last-child{grid-column:auto}
  .rat-filters{grid-template-columns:1fr}
  .rat-filters .rat-user-filter{grid-column:auto}
  .rat-panel-head{align-items:flex-start}
  .rat-panel-head em{display:none}
  .rat-day{padding:11px}
  .rat-shift{grid-template-columns:1fr 15px 1fr;min-height:50px}
  .rat-shift b{grid-column:1/-1;text-align:left;padding-top:3px;color:#5363da}
  .rat-shift small{grid-column:1/-1}
}
@media(prefers-reduced-motion:reduce){
  .rat-page *, .rat-page *:before,.rat-page *:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}

/* Dark mode: usa le variabili neumorfiche già impostate dal tema Rabbit. */
body[data-rabbit-theme="dark"] .rat-hero h1,
body[data-rabbit-theme="dark"] .rat-live-clock b,
body[data-rabbit-theme="dark"] .rat-status-line b,
body[data-rabbit-theme="dark"] .rat-hero-stats b,
body[data-rabbit-theme="dark"] .rat-team-summary b,
body[data-rabbit-theme="dark"] .rat-panel-head h2,
body[data-rabbit-theme="dark"] .rat-day header b,
body[data-rabbit-theme="dark"] .rat-shift b,
body[data-rabbit-theme="dark"] .rat-person b,
body.rabbit-theme-dark .rat-hero h1,
body.rabbit-theme-dark .rat-live-clock b,
body.rabbit-theme-dark .rat-status-line b,
body.rabbit-theme-dark .rat-hero-stats b,
body.rabbit-theme-dark .rat-team-summary b,
body.rabbit-theme-dark .rat-panel-head h2,
body.rabbit-theme-dark .rat-day header b,
body.rabbit-theme-dark .rat-shift b,
body.rabbit-theme-dark .rat-person b{
  color:var(--neo-text-strong,#f8fafc)!important;
}
body[data-rabbit-theme="dark"] .rat-hero p,
body[data-rabbit-theme="dark"] .rat-live-clock small,
body[data-rabbit-theme="dark"] .rat-status-line small,
body[data-rabbit-theme="dark"] .rat-panel-head p,
body[data-rabbit-theme="dark"] .rat-shift,
body[data-rabbit-theme="dark"] .rat-person small,
body.rabbit-theme-dark .rat-hero p,
body.rabbit-theme-dark .rat-live-clock small,
body.rabbit-theme-dark .rat-status-line small,
body.rabbit-theme-dark .rat-panel-head p,
body.rabbit-theme-dark .rat-shift,
body.rabbit-theme-dark .rat-person small{
  color:var(--neo-text-muted,#a9b5c1)!important;
}
body[data-rabbit-theme="dark"] .rat-shift,
body[data-rabbit-theme="dark"] .rat-team-table td,
body.rabbit-theme-dark .rat-shift,
body.rabbit-theme-dark .rat-team-table td{
  background:rgba(30,41,55,.56)!important;
  border-color:rgba(100,116,139,.28)!important;
}
body[data-rabbit-theme="dark"] .rat-team-table th,
body.rabbit-theme-dark .rat-team-table th{
  background:#263340!important;
  color:#bdc7d2!important;
}
