/* tQuadra Gestione attivita: portal style on tQTheme/Bootstrap 5 for the templates of AttivitaTemplates (classes tq-att-*).
   Same tokens and conventions as tickets-theme.css. Smarty compiles this file: every opening brace is followed by a space
   or a new line, and comments contain no braces. Variants use two classes, so they win over the Bootstrap utilities. */

/* Tokens: the values of the ticket portal. Zero specificity: the tokens of tickets-theme.css or of the installation theme win. */
:where(:root) {
  --tq-primary: #2563eb;
  --tq-primary-2: #1d4ed8;
  --tq-primary-soft: #eff6ff;
  --tq-primary-border: #bfdbfe;
  --tq-bg: #f1f5f9;
  --tq-surface: #fff;
  --tq-surface-2: #f8fafc;
  --tq-text: #0f172a;
  --tq-text-strong: #0f172a;
  --tq-text-body: #334155;
  --tq-muted: #64748b;
  --tq-border: #e2e8f0;
  --tq-border-strong: #cbd5e1;
  --tq-success: #15803d;
  --tq-success-soft: #dcfce7;
  --tq-warning: #b45309;
  --tq-warning-soft: #fef3c7;
  --tq-danger: #b91c1c;
  --tq-danger-soft: #fee2e2;
  --tq-side-from: #0b1222;
  --tq-side-to: #131c2e;
  --tq-side-text: #cbd5e1;
  --tq-side-active: rgba(37, 99, 235, .28);
  --tq-side-accent: #60a5fa;
  --tq-radius: 8px;
  --tq-radius-lg: 12px;
  --tq-shadow-soft: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --tq-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --tq-sidebar-width: 240px;
  --tq-topbar-height: 57px;
}
:root {
  --bs-body-bg: var(--tq-bg);
  --bs-body-color: var(--tq-text-body);
  --bs-border-color: var(--tq-border);
  --bs-link-color: var(--tq-primary);
  --bs-link-hover-color: var(--tq-primary-2);
}
/* The theme stylesheet (Bootstrap) loads after this one: one more selector than the Bootstrap rules. */
html .btn { --bs-btn-border-radius: var(--tq-radius); --bs-btn-font-weight: 600; }
.btn.btn-primary { --bs-btn-bg: var(--tq-primary); --bs-btn-border-color: var(--tq-primary); --bs-btn-hover-bg: var(--tq-primary-2); --bs-btn-hover-border-color: var(--tq-primary-2); --bs-btn-active-bg: var(--tq-primary-2); }
.btn.btn-outline-primary { --bs-btn-color: var(--tq-primary); --bs-btn-border-color: var(--tq-primary-border); --bs-btn-bg: var(--tq-surface); --bs-btn-hover-color: var(--tq-primary-2); --bs-btn-hover-bg: var(--tq-primary-soft); --bs-btn-hover-border-color: var(--tq-primary); --bs-btn-active-color: var(--tq-primary-2); --bs-btn-active-bg: var(--tq-primary-soft); }

/* Page frame: the activity pages use the whole width under the top bar. */
#appcontainer > .container-fluid:has(> .tq-att-workspace) { padding: 0; }
/* The header template is a .container-fluid too: the theme grows those, the header must stay as high as its bar. */
#appcontainer > header.container-fluid { flex-grow: 0; }
/* Logo on the left, language (when the site has more than one) and user menu on the right: the logo takes the free space,
   not the menu collapse nor the ms-auto of the language widget. */
#appcontainer > header > .navbar .navbar-brand { margin-right: auto; }
#appcontainer > header > .navbar .navbar-collapse { flex-grow: 0; }
#appcontainer > header > .navbar .tq-language-menu.ms-auto { margin-left: 0 !important; }

/* Workspace: navigation of the portal menu beside the page. */
.tq-att-workspace { display: grid; grid-template-columns: var(--tq-sidebar-width) minmax(0, 1fr); min-height: calc(100vh - var(--tq-topbar-height, 56px)); background: var(--tq-bg); }
.tq-att-sidebar { position: sticky; top: var(--tq-topbar-height); align-self: start; height: calc(100vh - var(--tq-topbar-height)); overflow-y: auto; min-width: 0; padding: 18px 12px; background: linear-gradient(180deg, var(--tq-side-from) 0%, var(--tq-side-to) 100%); }
.tq-att-sidebar .widget-block.nav { display: block; }
.tq-att-sidebar .navbar-nav { display: flex; flex-direction: column; gap: 2px; }
.tq-att-sidebar .nav-link,
.tq-att-sidebar .nav-item > .btn { display: flex; align-items: center; width: 100%; padding: 9px 12px; color: var(--tq-side-text); font-weight: 500; text-align: left; background: transparent; border: 0; border-radius: var(--tq-radius); }
.tq-att-sidebar .nav-link:hover,
.tq-att-sidebar .nav-item > .btn:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.tq-att-sidebar .nav-link.active,
.tq-att-sidebar .nav-item.current > .btn { color: #fff; font-weight: 600; background: var(--tq-side-active); box-shadow: inset 3px 0 var(--tq-side-accent); }
.tq-att-main { min-width: 0; padding: 24px 28px 40px; }
.tq-att-page-title,
.tq-att-page-title.h4 { margin-bottom: 20px !important; color: var(--tq-text); font-size: 1.5rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.tq-att-page-subtitle.h6 { color: var(--tq-muted); font-weight: 600; }
.tq-att-section-title,
.tq-att-section-title > * { color: var(--tq-text-strong); font-weight: 700; }

/* Home: search box and results of the activity search. */
.tq-att-search { margin-bottom: 12px; }
.tq-att-search .form-control { background: var(--tq-surface); border-color: var(--tq-border-strong); }
.tq-att-search .search-submit.btn { --bs-btn-bg: var(--tq-primary); --bs-btn-border-color: var(--tq-primary); --bs-btn-hover-bg: var(--tq-primary-2); --bs-btn-hover-border-color: var(--tq-primary-2); }
.tq-att-results .pagination-with-numresults { margin: 8px 0 12px; }
.tq-att-results .page-link { color: var(--tq-primary); border-color: var(--tq-border); }
.tq-att-results .page-item.active .page-link { color: var(--tq-surface); background: var(--tq-primary); border-color: var(--tq-primary); }
.tq-att-results .result-number-select .input-group-text { color: var(--tq-muted); background: var(--tq-surface-2); border-color: var(--tq-border); }

/* Registries: one card per list (clients, projects, recurring activities, actions). */
.tq-att-registry { min-width: 0; background: var(--tq-surface); border: 1px solid var(--tq-border); border-radius: var(--tq-radius-lg); box-shadow: var(--tq-shadow-soft); padding: 12px 16px 8px; }

/* Lists: header, rows, cells, row actions. */
/* The header cells are the theme's sort and search controls: only the row around them is styled. */
.tq-att-table-head { padding: 8px 0; border-bottom: 2px solid var(--tq-border); color: var(--tq-text-strong); font-weight: 600; }
.tq-att-table-head .actionItemContainer { display: inline-flex; }
.tq-att-row { background: var(--tq-surface); transition: background-color .12s; }
.tq-att-row:hover { background: var(--tq-surface-2); }
.tq-att-row.border-bottom { border-color: var(--tq-border) !important; }
.tq-att-row .actionItemContainer .btn { --bs-btn-padding-x: .45rem; }
.tq-att-row > [class*=col] { min-width: 0; overflow-wrap: anywhere; }
.tq-att-strong { color: var(--tq-text-strong); font-weight: 600; }
.tq-att-kicker { color: var(--tq-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; }
.tq-att-code { color: var(--tq-muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.tq-att-date { font-size: .875rem; white-space: nowrap; }
.tq-att-cell-number,
.tq-att-cell-date { font-variant-numeric: tabular-nums; }
.tq-att-row > .tq-att-cell-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.tq-att-row > .tq-att-cell-actions .actionItemContainer { margin: 0; }
.tq-att-cell-link { display: flex; align-items: center; gap: 6px; }
.tq-att-cell-email a { overflow-wrap: anywhere; }
.tq-att-html p:last-child { margin-bottom: 0; }

/* States of projects and tasks (rendered by the boolean fields). */
.tq-att-state { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .01em; }
.tq-att-state.tq-att-state--open { color: var(--tq-success); background: var(--tq-success-soft); }
.tq-att-state.tq-att-state--closed { color: var(--tq-muted); background: var(--tq-surface-2); border: 1px solid var(--tq-border); }

/* Projects: the tasks of the project open below its row. */
.tq-att-row.tq-att-row--commesse { align-items: flex-start !important; }
.tq-att-row--commesse > .tq-att-cell-name .tq-att-code { display: inline-block; margin-right: 8px; }
.tq-att-subtable { margin-top: 4px; padding: 8px 12px 4px; background: var(--tq-surface-2); border-left: 3px solid var(--tq-primary); border-radius: var(--tq-radius); }
.tq-att-subtable .tq-att-row { background: transparent; }
.tq-att-subtable .tq-att-row:hover { background: var(--tq-surface); }
.tq-att-subtable .tq-att-table-head { border-bottom-width: 1px; font-size: .875rem; }

/* Monthly reports of projects and clients (confirmation form, then PDF or ZIP). */
.tq-att-report-action .btn-outline-primary { --bs-btn-color: var(--tq-success); --bs-btn-border-color: var(--tq-success); --bs-btn-hover-bg: var(--tq-success); --bs-btn-hover-border-color: var(--tq-success); --bs-btn-active-bg: var(--tq-success); }

/* Activities: datatable2 (FixedDataTable). The header cells carry tq-att-grid (class of the table), the body cells
   tq-att-grid-cell (row class of the table); the cell draws its own bottom border inline, recoloured here. */
.fixedDataTableLayout_main:has(.tq-att-grid-cell) { border-color: var(--tq-border); border-radius: var(--tq-radius); }
.tq-att-grid { color: var(--tq-muted); background: var(--tq-surface-2); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.tq-att-grid .btn-sort.btn { width: 24px; height: 24px; padding: 0; color: var(--tq-border-strong); background: transparent !important; border: 0; }
.tq-att-grid-cell { color: var(--tq-text); background: var(--tq-surface); border-bottom-color: var(--tq-border) !important; line-height: 1.35; }
.public_fixedDataTableRow_main:hover .tq-att-grid-cell { background: var(--tq-primary-soft); }
.tq-att-grid .public_fixedDataTableCell_cellContent,
.tq-att-grid-cell .public_fixedDataTableCell_cellContent,
.public_fixedDataTableCell_cellContent.tq-att-grid-cell { padding: 8px 10px; }
/* Row actions and the buttons of project and task details stay on one line beside the value. */
.tq-att-grid-cell .actionItemContainer { display: inline-flex; vertical-align: middle; margin: 0 4px 0 0; }
.tq-att-grid-cell .btn { margin-right: 4px; }
.tq-att-grid-toolbar .actionItemContainer { margin: 0; }

/* Lists of the activity pages in the portal style: light header, rows without column borders, toolbar as outline buttons. */
.tq-att-main .public_fixedDataTable_main { border: 1px solid var(--tq-border) !important; border-radius: var(--tq-radius); background: var(--tq-surface); }
.tq-att-main .public_fixedDataTable_header,
.tq-att-main .public_fixedDataTable_header .public_fixedDataTableCell_main { background: var(--tq-surface-2) !important; background-image: none !important; }
.tq-att-main .public_fixedDataTableCell_main { border-color: transparent; }
.tq-att-main .public_fixedDataTable_header .public_fixedDataTableCell_main { border-color: var(--tq-border) !important; }
.tq-att-main .datatable-toolbar .btn,
.tq-att-main .utility-header .btn,
.tq-att-main .result-headeraction .btn { --bs-btn-color: var(--tq-text-body); --bs-btn-bg: var(--tq-surface); --bs-btn-border-color: var(--tq-border-strong); --bs-btn-hover-color: var(--tq-text); --bs-btn-hover-bg: var(--tq-surface-2); --bs-btn-hover-border-color: var(--tq-muted); }

/* Records: heading with actions, facts, long texts. */
.tq-att-record { color: var(--tq-text); }
.tq-att-record-header { position: sticky; top: 0; z-index: 10; background: var(--tq-surface); }
.tq-att-record-header.border-bottom { border-color: var(--tq-border) !important; }
.tq-att-record-kicker { text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.tq-att-record-title,
.tq-att-record-title.h4,
.tq-att-record-title.h5 { color: var(--tq-text-strong); font-weight: 700; line-height: 1.3; }
.tq-att-actions { justify-content: flex-end; }
.tq-att-facts { row-gap: 12px; }
.tq-att-fact { min-width: 0; }
.tq-att-fact > div,
.tq-att-fact > span:not(.tq-att-fact-label) { overflow-wrap: anywhere; }
.tq-att-fact-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.tq-att-attachments.border-top { border-color: var(--tq-border) !important; }

/* Notes popover and calendar agenda line. */
.tq-att-notes { max-width: min(520px, 80vw); max-height: 50vh; overflow-y: auto; line-height: 1.5; overflow-wrap: anywhere; }
.tq-att-notes p:last-child { margin-bottom: 0; }
.tq-att-agenda { font-size: .875rem; }

/* Forms in the modals: activity, project, task, client, recurring activity, action, billing note. */
.tq-att-form .form-control,
.tq-att-form .form-select { border-color: var(--tq-border); }
.tq-att-form .form-control:focus,
.tq-att-form .form-select:focus { border-color: var(--tq-primary); box-shadow: 0 0 0 .2rem rgba(1,118,211,.15); }
.tq-att-form textarea.form-control { min-height: 140px; }
.tq-att-form .tq-att-form-section { color: var(--tq-text-strong); font-weight: 700; padding-top: 8px; border-top: 1px solid var(--tq-border); }

/* Calendar: the activities of the operators (Eventi calendar widget in the body slot). */
.tq-att-calendar { min-width: 0; background: var(--tq-surface); border: 1px solid var(--tq-border); border-radius: var(--tq-radius-lg); box-shadow: var(--tq-shadow-soft); padding: 12px; }
.tq-att-calendar .reactCalendarContainer { max-width: 100%; overflow-x: hidden; }
.tq-att-calendar .reactCalendarSidebar { border-right: 1px solid var(--tq-border); padding-right: 12px; margin-right: 12px; }
.tq-att-calendar .calendarToolbarLabel { color: var(--tq-text-strong); font-weight: 700; }
.tq-att-calendar .rbc-header { padding: 6px 4px; color: var(--tq-text-strong); font-weight: 600; border-color: var(--tq-border); }
.tq-att-calendar .rbc-month-view,
.tq-att-calendar .rbc-time-view,
.tq-att-calendar .rbc-agenda-view table.rbc-agenda-table { border-color: var(--tq-border); border-radius: var(--tq-radius); }
.tq-att-calendar .rbc-today { background: var(--tq-primary-soft); }
.tq-att-calendar .rbc-off-range-bg { background: var(--tq-surface-2); }
.tq-att-calendar .rbc-header:last-child { color: var(--tq-danger); background: var(--tq-danger-soft); }
.tq-att-calendar .rbc-row-bg .rbc-day-bg:last-child,
.tq-att-calendar .rbc-time-content .rbc-day-slot:last-child { background: var(--tq-surface-2); }
.tq-att-calendar .rbc-event.rbc-selected { border-color: var(--tq-primary); }
.tq-att-calendar .rbc-time-view .rbc-event-label { font-weight: 700; }
.tq-att-calendar .rbc-overlay { max-height: 200px; overflow: auto; }
.tq-att-calendar .containerEventoInterno { font-size: .875rem; }

/* Ticket view (context column): activities and tasks of the ticket as compact entries. */
.tq-att-ticket-partial { min-width: 0; }
.tq-att-ticket-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tq-att-ticket-title { margin: 0; color: var(--tq-muted); font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.tq-att-ticket-entry { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--tq-border); font-size: .875rem; }
.tq-att-ticket-entry:last-child { border-bottom: 0; }
.tq-att-ticket-text { min-width: 0; }
.tq-att-ticket-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--tq-muted); font-size: .8125rem; }
.tq-att-ticket-main { display: flex; flex-wrap: wrap; gap: 6px; color: var(--tq-text); }

/* Tablets and phones: navigation above the page, compact spacing, stacked rows. */
@media (max-width: 991.98px) {
  .tq-att-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-content: start; }
  .tq-att-sidebar { position: static; height: auto; padding: 8px 12px; overflow-x: auto; }
  .tq-att-sidebar .navbar-nav { flex-direction: row; gap: 4px; }
  .tq-att-sidebar .nav-link,
  .tq-att-sidebar .nav-item > .btn { width: auto; white-space: nowrap; }
  .tq-att-sidebar .nav-item.current > .btn { box-shadow: inset 0 -3px var(--tq-side-accent); }
  .tq-att-main { padding: 16px; }
  .tq-att-actions { justify-content: flex-start; }
  .tq-att-row > .tq-att-cell-actions { justify-content: flex-start; }
  .tq-att-calendar { padding: 8px; }
  .tq-att-calendar .reactCalendarContainer { flex-wrap: wrap; }
  .tq-att-calendar .reactCalendarContainer > .reactCalendarSidebar { flex: 1 1 100%; width: 100%; border-right: 0; border-bottom: 1px solid var(--tq-border); padding: 0 0 8px; margin: 0 0 8px; }
  .tq-att-calendar .reactCalendarContainer > .reactCalendarBigCalendar { flex: 1 1 100%; width: 100%; }
}
@media (max-width: 575.98px) {
  .tq-att-row.py-2 { padding-top: 12px !important; padding-bottom: 12px !important; }
  .tq-att-registry { padding: 8px 10px 4px; }
  .tq-att-record-header { position: static; }
  .tq-att-date { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .tq-att-row { transition: none; }
}

/* Hour packages of the client (page «Le tue ore»): one card per package, usage bar, hours and end date. */
.tq-att-package { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; padding: 1rem 1.25rem; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.tq-att-package-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.tq-att-progress { width: 100%; height: 10px; border: 0; border-radius: 999px; background: #e2e8f0; accent-color: #2563eb; }
.tq-att-progress::-webkit-progress-bar { border-radius: 999px; background: #e2e8f0; }
.tq-att-progress::-webkit-progress-value { border-radius: 999px; background: #2563eb; }
.tq-att-progress--over::-webkit-progress-value { background: #dc2626; }
.tq-att-package-hours { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; color: #475569; font-size: .875rem; }
.tq-att-package-hours > span:first-child { color: #0f172a; font-weight: 600; }
