/* VertiForce Mobile: shared visual layer, independent of access and data logic. */
:root {
  color-scheme: dark;
  --bg-primary: #101722;
  --bg-card: #1a2331;
  --bg-input: #121b28;
  --accent-blue: #91acff;
  --accent-emerald: #6cdbb9;
  --accent-amber: #f0c578;
  --accent-rose: #ffa1ad;
  --text-main: #f5f7fc;
  --text-muted: #a4b1c5;
  --border-color: #2c384c;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow-main: 0 16px 40px #040b172e;
  --transition-fast: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
body { align-items: flex-start; background: #0c121c; line-height: 1.5; }
.app-container { max-width: 520px; background: var(--bg-primary); box-shadow: none; }
.main-layout { min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }
.ui-icon { width: 24px; height: 24px; flex: none; display: block; }
button { touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid #91acff; outline-offset: 4px; }
button:disabled { opacity: .55; cursor: wait; }
.btn, .btn-sm { min-height: 48px; font-size: 15px; letter-spacing: -.15px; }
.btn-primary { background: #7395f7; color: #0b1530; box-shadow: none; font-weight: 750; }
.btn-primary:hover { background: #8aa7ff; }
.btn-secondary { background: #243146; border: 1px solid #34435a; color: var(--text-main); }
.btn-success { background: #6cdbb9; color: #0b2a22; box-shadow: none; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-spinner { width: 22px; height: 22px; border: 2px solid #0b153033; border-top-color: #0b1530; border-radius: 50%; animation: spin .8s linear infinite; }
.eyebrow { font-size: 10px; letter-spacing: 1.8px; font-weight: 750; color: var(--accent-blue); }
/* Accesso */
.login-wrapper { padding: 32px 24px 22px; min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); justify-content: flex-start; gap: 28px; }
.brand-header { margin: 0; text-align: left; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 42px; }
.login-brand > span:first-of-type { font-size: 21px; font-weight: 750; letter-spacing: -.7px; }
.logo-icon { margin: 0; width: 38px; height: 42px; border-radius: 12px; background: #7395f7; color: #101c38; -webkit-text-fill-color: currentColor; display: grid; place-items: center; }
.logo-icon .ui-icon { width: 24px; height: 24px; }
.brand-edition { margin-left: auto; border: 1px solid #344058; color: #a4b1c5; font-size: 9px; letter-spacing: 1.5px; padding: 5px 8px; border-radius: 6px; }
.brand-header .eyebrow { color: var(--accent-blue); margin: 0 0 14px; font-size: 10px; }
.brand-header h1 { font-size: clamp(29px, 7.4vw, 35px); line-height: 1.18; font-weight: 750; letter-spacing: -1.3px; }
.brand-header h1 span { color: #a8b9d6; font-weight: 500; }
.brand-header .login-intro { margin: 17px 0 0; font-size: 14px; line-height: 1.65; }
.login-card { padding: 24px 20px; background: #1a2331; border: 1px solid #2c384c; border-radius: 24px; box-shadow: none; backdrop-filter: none; }
.login-card-heading { margin-bottom: 23px; }
.login-card-heading h2 { font-size: 19px; font-weight: 650; letter-spacing: -.5px; }
.login-card-heading p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.form-group label { color: #c9d3e3; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.input-icon { color: #93a5c2; left: 15px; }
.input-icon .ui-icon { width: 19px; height: 19px; }
.form-control, input[type="text"], input[type="password"], input[type="time"], input[type="number"], select, textarea { min-height: 50px; border-radius: 12px; font-size: 16px; border-color: #34435a; }
input::placeholder, textarea::placeholder { color: #91a0b8; opacity: 1; }
.remember-login { font-size: 11px; color: #a4b1c5; line-height: 1.6; gap: 9px; margin: 18px 0; }
.remember-login .ui-icon { width: 16px; height: 16px; color: #79cbb4; }
.login-card .btn-primary { min-height: 52px; border-radius: 13px; }
.app-footer { display: grid; gap: 5px; margin-top: auto; padding-top: 4px; font-size: 10px; color: #94a3ba; }
.alert-danger { color: #ffc1c9; background: #4d263033; text-align: left; border-color: #95475b; line-height: 1.6; }
/* Navigazione */
.app-header { min-height: 76px; padding: 16px 20px; background: #101722f5; border-color: #273246; gap: 12px; }
.user-badge { min-width: 0; gap: 10px; }
.avatar { width: 42px; height: 42px; flex: none; background: #263753; color: #b9caff; border-radius: 14px; font-size: 13px; }
.user-info { min-width: 0; gap: 2px; }
.user-name { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { flex: none; gap: 6px; align-items: center; }
.icon-btn, .header-home-btn { width: 40px; height: 44px; min-height: 44px; padding: 0; border-radius: 12px; border: 1px solid #29374d; background: #182131; color: #b9c6dc; display: grid; place-items: center; }
.icon-btn .ui-icon, .header-home-btn .ui-icon { width: 19px; height: 19px; }
.icon-btn.danger { color: #d6afb7; }
.nav-tabs { top: 76px; background: #131c29; border-color: #273246; }
.nav-tab { min-height: 65px; border-bottom-width: 2px; }
.nav-tab.active { background: #1e2b43; color: #b8caff; }
.badge { background: #738fdc; color: #101722; }
.sync-status { background: #20314b; border: 1px solid #38537a; border-radius: 13px; margin: 10px 20px; font-size: 13px; }
/* Home */
.mobile-home { padding: 32px 22px 24px; gap: 26px; }
.home-intro .eyebrow { margin-bottom: 14px; }
.home-intro h2 { font-size: clamp(29px, 8vw, 36px); font-weight: 650; letter-spacing: -1.3px; line-height: 1.16; }
.home-intro > p:last-child { color: var(--text-muted); font-size: 14px; margin-top: 15px; }
.home-modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mobile-home .module-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 27px; min-height: 178px; width: 100%; padding: 19px 17px; border: 1px solid #2d3a50; border-radius: 22px; background: #1a2331; text-align: left; box-shadow: none; white-space: normal; }
.module-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #b2c6ff; background: #2a3957; }
.module-mint .module-icon { background: #223f3b; color: #84dec3; }
.module-violet .module-icon { background: #38314e; color: #c4b0ee; }
.module-amber .module-icon { background: #413727; color: #edc883; }
.module-copy { display: grid; gap: 4px; }
.module-copy strong { font-size: 15px; letter-spacing: -.3px; font-weight: 650; color: #f1f4fa; }
.module-copy > span { font-size: 11px; font-weight: 400; color: #a8b5c9; line-height: 1.5; }
.module-arrow { position: absolute; top: 25px; right: 13px; color: #9baac1; }
.module-arrow .ui-icon { width: 16px; height: 16px; }
.module-card:hover { border-color: #617da9; background: #202c3d; }
.home-brand-note { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px; color: #899ab4; font-size: 10px; padding: 8px 0; }
.home-brand-note .ui-icon { width: 13px; height: 13px; }
.home-brand-divider { width: 3px; height: 3px; border-radius: 50%; background: #566a88; }
#homePermissionsStatus { padding: 16px; border: 1px solid #354762; border-radius: 15px; background: #1c2b40; color: #c4d4ee; font-size: 14px; line-height: 1.6; }
/* Interventi e moduli */
.content-area { padding: 22px 20px; }
.date-selector-bar { border-radius: 15px; padding: 8px 10px; background: #1a2331; }
.date-title { color: #c9d7f5; }
.btn-sm { padding: 8px 12px; background: #27354a; }
.pill-btn.active { background: #365951; color: #b9f0df; }
.appt-card, .check-card, .check-group, .expense-card { box-shadow: none; border-color: #2d3a50; border-radius: 20px; background: #1a2331; }
.appt-card { padding: 20px; }
.commessa-tag { color: #b7c9fb; background: #283852; padding: 5px 8px; border-radius: 6px; font-size: 11px; }
.client-name { font-size: 20px; letter-spacing: -.6px; }
.card-info { font-size: 13px; line-height: 1.65; }
.card-actions { flex-wrap: wrap; }
.card-actions .btn { flex: 1 1 125px; padding: 12px 14px; }
.status-pill { font-size: 10px; padding: 6px 9px; letter-spacing: .25px; }
.empty-state { padding: 48px 20px; font-size: 14px; }
.check-header h2, #expenseHeading { font-size: 24px; font-weight: 650; letter-spacing: -.7px; }
#checklistsScreen { padding: 22px 20px; }
#expensesScreen { background: var(--bg-primary); color: var(--text-main); }
#expensesScreen .expense-card { background: #1a2331; border: 1px solid #2d3a50; border-radius: 20px; }
#expenseForm :is(input, select, textarea), #calendarCreateForm :is(input:not([type=checkbox]), textarea) { background: #121b28; border-color: #34435a; border-radius: 12px; padding: 14px; font-size: 16px; }
#expenseForm label, #calendarCreateForm label { color: #cbd6e7; font-size: 13px; }
#expenseStatus, #checkStatus, #calendarCreateStatus:not(:empty) { border: 1px solid #35445c; border-radius: 14px; background: #1c2a3d; color: #d1dbee; padding: 14px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
#expenseStatus:empty, #calendarCreateStatus:empty { display: none; }
.expense-menu { gap: 12px; }
.expense-menu .btn { justify-content: flex-start; min-height: 70px; padding: 20px; border-radius: 18px; font-size: 17px; }
/* Calendario */
.calendar-header { margin-bottom: 22px; gap: 10px; }
.calendar-heading { text-align: center; }
.calendar-heading .eyebrow { font-size: 9px; margin-bottom: 5px; }
.calendar-header h2 { font-size: 21px; font-weight: 600; letter-spacing: -.5px; }
.calendar-header > .btn { width: 42px; min-height: 44px; padding: 0; border-radius: 13px; flex: none; }
.calendar-header > .btn .ui-icon { width: 17px; height: 17px; }
#calendarCreateOpen { width: 100%; margin-bottom: 8px; border-radius: 14px; }
.calendar-grid { gap: 5px; margin: 24px 0; }
.calendar-grid > strong { color: #9faec5; font-size: 10px; padding-bottom: 6px; font-weight: 500; }
.calendar-day { min-height: 47px; background: #1a2536; border: 1px solid #2d3b52; border-radius: 12px; font-size: 13px; color: #c8d4e9; }
.calendar-day.selected { background: #7899f5; border-color: #90adff; color: #0c1837; font-weight: 700; }
.calendar-day-count { min-width: 14px; width: fit-content; height: 14px; margin: 2px auto 0; padding: 0 4px; font-size: 9px; display: flex; background: #89dfc4; color: #12352f; }
.calendar-day.selected .calendar-day-count { background: #1a3e43; color: #c4f1e4; }
.calendar-day-items { gap: 12px; }
.calendar-day-items > h3 { font-size: 13px; font-weight: 600; color: #acbbd3; margin-bottom: 3px; }
.calendar-item { border: 1px solid #2d3a50; background: #1a2331; border-radius: 19px; padding: 17px; font-size: 14px; line-height: 1.6; }
.calendar-item h3 { font-size: 16px; margin-bottom: 7px; font-weight: 600; }
.calendar-item .btn { margin: 14px 8px 0 0; min-height: 44px; font-size: 12px; padding: 10px 16px; }
/* Foglio ore */
.modal-overlay { height: 100dvh; background: #050b15b8; }
.modal-card { max-width: 520px; border-radius: 28px 28px 0 0; }
#timesheetModal .modal-card { border-color: #34435a; padding: 24px 20px; }
#timesheetModal .timesheet-period, #timesheetModal .timesheet-totals, #timesheetModal #signatureGroup { border-color: #34435a; border-radius: 18px; }
#timesheetModal .form-control { border-color: #3c4e68; border-radius: 11px; }
#timesheetModal .hours-incomplete { border-color: #ffa1ad !important; }
.timesheet-day-summary > div { border-radius: 13px; border-color: #34435a; padding: 12px; }
@media (max-width: 360px) {
  .login-wrapper { padding: 25px 18px 20px; gap: 24px; }
  .login-brand { margin-bottom: 30px; }
  .brand-header h1 { font-size: 28px; }
  .login-card { padding: 22px 17px; }
  .app-header { padding: 16px 14px; gap: 8px; }
  .avatar { width: 36px; height: 40px; }
  .user-badge { gap: 7px; }
  .header-actions { gap: 4px; }
  .header-home-btn, .icon-btn { width: 38px; }
  .mobile-home { padding: 28px 18px 22px; }
  .mobile-home .module-card { min-height: 171px; padding: 17px 14px; }
  .module-copy strong { font-size: 14px; }
  .module-copy > span { font-size: 10px; }
  .content-area, #checklistsScreen { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.section-description { color: var(--text-muted); font-size: 13px; margin-top: 7px; }
.expense-menu .action-tile { display: flex; align-items: center; gap: 15px; background: #1a2331; border: 1px solid #2d3a50; min-height: 98px; padding: 18px; text-align: left; }
.action-tile .module-icon { flex: none; background: #223f3b; color: #84dec3; }
#expenseSentOpen .module-icon { background: #2a3957; color: #b2c6ff; }
.action-tile .module-copy strong { font-size: 16px; }
.action-tile .module-copy > span { font-size: 11px; }
.action-arrow { margin-left: auto; color: #99aac4; }
.action-arrow .ui-icon { width: 16px; height: 16px; }

.calendar-local-state { color: var(--accent-blue); font-size: 12px; border-left: 3px solid currentColor; padding-left: 10px; margin-top: 12px; }
