/* Instanzidentität */
.topbar-left {
    display: flex;
    align-items: baseline;
    gap: .65rem;
    min-width: 0;
}

.topbar-left .instance-name {
    font-size: .82rem;
    font-weight: 500;
    opacity: .72;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 28rem;
}

.login-brand {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    margin-bottom: 1rem;
}

.login-brand strong {
    font-size: 1.35rem;
}

.login-brand span {
    color: var(--muted, #6b7280);
    font-size: .9rem;
}

/* =========================================================
   Dashboard
   ========================================================= */
.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-header {
    min-height: 66px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.2rem 0 0.35rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-header h2 {
    margin: 0.15rem 0 0;
    font-size: 1.65rem;
    letter-spacing: -0.02em;
}

.dashboard-eyebrow {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dashboard-header-date {
    padding-bottom: 0.1rem;
    color: var(--muted);
    font-size: 0.86rem;
    white-space: nowrap;
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.dashboard-kpi {
    min-width: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
}

.dashboard-kpi span,
.dashboard-kpi strong {
    display: block;
}

.dashboard-kpi span {
    color: var(--muted);
    font-size: 0.77rem;
    line-height: 1.25;
}

.dashboard-kpi strong {
    margin-top: 0.22rem;
    font-size: 1.3rem;
    line-height: 1.15;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(285px, 0.75fr);
    align-items: start;
    gap: 1rem;
}

.dashboard-main-column,
.dashboard-side-column {
    min-width: 0;
}

.dashboard-side-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-card {
    margin: 0;
    padding: 1rem 1.05rem;
}

.dashboard-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.dashboard-card-head h3 {
    margin: 0;
    font-size: 0.98rem;
}

.dashboard-card-head p {
    margin: 0.15rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.dashboard-card-head a {
    flex: 0 0 auto;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
}

.dashboard-card-head a:hover {
    text-decoration: underline;
}

.dashboard-client-list,
.dashboard-history-list,
.dashboard-attention-list,
.dashboard-time-list {
    display: flex;
    flex-direction: column;
}

.dashboard-client-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0;
    border-top: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
}

.dashboard-client-row:first-child,
.dashboard-history-row:first-child,
.dashboard-attention-row:first-child,
.dashboard-time-row:first-child {
    border-top: 0;
}

.dashboard-client-row:hover strong,
.dashboard-history-row:hover strong {
    color: var(--primary);
}

.dashboard-client-main {
    min-width: 0;
}

.dashboard-client-main strong,
.dashboard-client-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-client-main small,
.dashboard-client-row time {
    color: var(--muted);
    font-size: 0.75rem;
}

.dashboard-client-row time {
    white-space: nowrap;
}

.dashboard-history-row {
    display: block;
    padding: 0.82rem 0;
    border-top: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
}

.dashboard-history-topline {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-history-topline time,
.dashboard-history-meta {
    color: var(--muted);
    font-size: 0.75rem;
}

.dashboard-history-topline time {
    white-space: nowrap;
}

.dashboard-history-meta {
    margin-top: 0.14rem;
}

.dashboard-history-text {
    margin-top: 0.3rem;
    color: #4b5563;
    font-size: 0.84rem;
    line-height: 1.45;
}

.dashboard-attention-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    padding: 0.62rem 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.82rem;
}

.dashboard-attention-count {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 0.8rem;
    font-weight: 800;
}

.dashboard-attention-row.has-items {
    color: var(--text);
}

.dashboard-attention-row.has-items .dashboard-attention-count {
    background: #fff7ed;
    color: #c2410c;
}

.dashboard-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.68rem 0;
    border-top: 1px solid var(--border);
}

.dashboard-time-row span {
    color: var(--muted);
    font-size: 0.82rem;
}

.dashboard-time-row strong {
    font-size: 0.92rem;
}

.dashboard-time-row-main {
    margin-top: 0.25rem;
    padding: 0.72rem 0.75rem;
    border: 0;
    border-radius: 8px;
    background: #eff6ff;
}

.dashboard-time-row-main span,
.dashboard-time-row-main strong {
    color: #1d4ed8;
}

.dashboard-empty {
    padding: 0.8rem 0;
    color: var(--muted);
    font-size: 0.82rem;
}

/* Statistik
   Verwendet dieselbe Tab-Komponente wie die Einstellungen. */
.statistics-tabs {
    margin-top: 0;
}

.statistics-section-heading {
    margin-bottom: 0.85rem;
}

.statistics-section-heading h3 {
    margin: 0;
}

.statistics-section-heading p {
    margin: 0.2rem 0 0;
}

@media (max-width: 1000px) {
    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }
    .dashboard-header-date {
        padding-bottom: 0.2rem;
        white-space: normal;
    }
    .dashboard-kpis {
        grid-template-columns: 1fr;
    }
    .dashboard-history-topline {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.12rem;
    }
}


/* Klienten-Stammdaten */
.client-master-form .master-section {
    padding: 1.1rem 0 0.35rem;
    border-top: 1px solid var(--border);
}

.client-master-form .master-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.client-master-form .master-section h3,
.master-data-section h3 {
    margin: 0 0 0.9rem;
    font-size: 1rem;
}

.client-master-form .form-group small {
    display: block;
    margin-top: -0.65rem;
    margin-bottom: 1rem;
}

.readonly-value {
    min-height: 2.45rem;
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    margin-bottom: 1rem;
}

.form-actions,
.client-master-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.form-actions {
    padding-top: 0.75rem;
}

.client-master-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.client-master-title h2 {
    margin-bottom: 0.15rem;
}

.master-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.master-data-section {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    min-width: 0;
}

.master-data-section dl {
    margin: 0;
}

.master-data-section dl > div {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
    gap: 0.8rem;
    padding: 0.42rem 0;
    border-top: 1px solid var(--border);
}

.master-data-section dl > div:first-child {
    border-top: 0;
    padding-top: 0;
}

.master-data-section dt {
    color: var(--muted);
    font-size: 0.9rem;
}

.master-data-section dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.master-data-section a {
    color: var(--primary);
    text-decoration: none;
}

.master-data-section a:hover {
    text-decoration: underline;
}

.master-data-notes {
    margin-top: 1rem;
}

.preserve-lines {
    white-space: pre-wrap;
}

.client-master-actions {
    margin-top: 1rem;
}

.client-status {
    font-weight: 600;
}

.client-status-active {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.client-status-paused {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.client-status-completed {
    border-color: #d1d5db;
    background: #f3f4f6;
    color: #4b5563;
}

@media (max-width: 800px) {
    .master-data-grid {
        grid-template-columns: 1fr;
    }

    .master-data-section dl > div {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
}

.client-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.3rem;
}

.master-section-intro {
    margin: -0.35rem 0 1rem;
}

.custom-client-fields .form-group {
    min-width: 0;
}

.custom-client-fields .custom-field-wide {
    grid-column: 1 / -1;
}

/* Benutzerdefinierte Klientenfelder */
.client-field-create-form {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.client-field-flags {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    min-height: 3.4rem;
    padding-top: 1.65rem;
}

.client-field-flags .checkbox-row {
    margin-bottom: 1rem;
}

.client-field-admin-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 1.25rem;
}

.client-field-editor {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: var(--card);
}

.client-field-editor-head,
.client-field-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.client-field-editor-head {
    margin-bottom: 0.8rem;
}

.client-field-editor-footer {
    padding-top: 0.8rem;
    margin-top: 0.8rem;
    border-top: 1px solid var(--border);
}

.client-field-editor-footer form {
    margin: 0;
}

.client-field-empty {
    padding: 0.5rem 0;
}

@media (max-width: 700px) {
    .client-field-flags,
    .client-field-editor-head,
    .client-field-editor-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.5rem;
    }
    .client-field-flags {
        padding-top: 0;
    }
}


/* Ruhige, tabellenartige Stammdatenansicht */
.client-master-data-clean {
    padding: 0;
    overflow: hidden;
}

.client-master-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.4rem;
    border-bottom: 1px solid var(--border);
}

.client-master-summary-main {
    min-width: 0;
}

.client-master-summary-main h2 {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.25;
}

.client-master-summary-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.42rem;
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.client-master-summary-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 0 0 auto;
}

.client-master-table {
    padding: 0 1.4rem 1.25rem;
}

.client-master-table-section {
    padding-top: 1.25rem;
}

.client-master-table-section + .client-master-table-section {
    margin-top: 0.2rem;
}

.client-master-table-section h3 {
    margin: 0 0 0.2rem;
    padding-bottom: 0.55rem;
    border-bottom: 2px solid var(--border);
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text);
}

.client-master-table-section dl {
    margin: 0;
}

.client-master-row {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    min-height: 2.65rem;
    padding: 0.62rem 0.35rem;
    border-bottom: 1px solid var(--border);
}

.client-master-row:last-child {
    border-bottom: 0;
}

.client-master-row dt {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.client-master-row dd {
    margin: 0;
    min-width: 0;
    color: var(--text);
    font-weight: 500;
    overflow-wrap: anywhere;
}

.client-master-row a {
    color: var(--primary);
    text-decoration: none;
}

.client-master-row a:hover {
    text-decoration: underline;
}

.client-master-footer-actions {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.4rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

@media (max-width: 700px) {
    .client-master-summary {
        align-items: flex-start;
    }

    .client-master-table {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .client-master-row {
        grid-template-columns: 1fr;
        gap: 0.15rem;
        padding-top: 0.7rem;
        padding-bottom: 0.7rem;
    }

    .client-master-row dt {
        font-size: 0.82rem;
    }
}

/* Abgeschlossene Klienten / Archivnavigation */
.sidebar-archive-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.sidebar-link-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--surface-soft, #f1f3f5);
  color: var(--muted, #667085);
  font-size: .75rem;
  font-weight: 700;
}
.sidebar-overview-link.active .sidebar-link-count {
  background: rgba(255,255,255,.7);
}
.client-list-heading {
  margin-bottom: 1rem;
}
.client-overview-list {
  margin-top: 0;
}


/* Zentrale Klientenübersicht */
.client-directory-heading {
    align-items: flex-end;
    margin-bottom: 1rem;
}

.client-directory-heading h2 {
    margin-bottom: 0.2rem;
}

.client-directory-filter-card {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
}

.client-directory-filter-form,
.client-directory-filter-form .form-group {
    margin: 0;
}

.client-directory-filter-grid {
    display: grid;
    grid-template-columns: minmax(180px, 0.55fr) minmax(300px, 1.65fr) auto;
    align-items: end;
    gap: 0.9rem;
}

.client-directory-filter-grid label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.client-directory-filter-grid input,
.client-directory-filter-grid select {
    width: 100%;
    margin: 0;
}

.client-directory-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.client-directory-card {
    padding: 0;
    overflow: hidden;
}

.client-directory-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.client-directory-table-head > div {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
}

.client-directory-table th {
    white-space: nowrap;
}

.client-directory-table td {
    vertical-align: middle;
}

.client-directory-table tbody tr {
    transition: background 0.12s ease;
}

.client-directory-table tbody tr:hover {
    background: #fafafa;
}

.client-directory-number {
    white-space: nowrap;
    color: var(--muted);
    font-weight: 600;
}

.client-directory-name {
    display: block;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.client-directory-name:hover {
    color: var(--primary);
    text-decoration: underline;
}

.client-directory-secondary {
    display: block;
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.client-directory-contact {
    min-width: 190px;
}

.client-directory-contact span,
.client-directory-contact a {
    display: block;
    overflow-wrap: anywhere;
}

.client-directory-contact a {
    margin-top: 0.15rem;
    color: var(--primary);
    text-decoration: none;
}

.client-directory-contact a:hover {
    text-decoration: underline;
}

.client-directory-empty {
    padding: 1.25rem 0.4rem;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 850px) {
    .client-directory-filter-grid {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .client-directory-filter-actions {
        white-space: normal;
    }

    .client-directory-heading {
        align-items: flex-start;
    }
}

/* File-manager toolbar icon/rendering hardening */
.file-tool-button .file-tool-icon {
    display: block !important;
    width: 19px !important;
    height: 19px !important;
    min-width: 19px;
    min-height: 19px;
    max-width: none;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none;
}

/* Upload is a modal, independent of the file table stacking context. */
.upload-toolbar-menu[open] {
    z-index: 3000;
}

.upload-toolbar-menu[open]::before {
    content: "";
    position: fixed;
    z-index: 2998;
    inset: 0;
    background: rgba(17, 24, 39, .18);
}

.upload-toolbar-menu .explorer-upload-panel {
    position: fixed;
    z-index: 3000;
    top: 50%;
    left: 50%;
    width: min(620px, calc(100vw - 2rem));
    max-height: calc(100vh - 3rem);
    margin: 0;
    overflow: auto;
    transform: translate(-50%, -50%);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.file-upload-close {
    position: absolute;
    z-index: 1;
    top: .55rem;
    right: .65rem;
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.file-upload-close:hover,
.file-upload-close:focus-visible {
    background: var(--bg);
    color: var(--text);
    outline: none;
}

.upload-toolbar-menu .explorer-upload-panel .file-upload-form {
    padding-top: .15rem;
}

/* The empty table state must never form a layer above dialogs. */
.file-manager-table,
.file-manager-table tbody,
.file-manager-empty {
    position: relative;
    z-index: 0;
}


/* File manager toolbar v2: one consistent icon row + native upload dialog */
.file-manager-toolbar {
    justify-content: flex-start;
    min-height: 48px;
    padding: 0.38rem 0.7rem;
}

.file-toolbar-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.28rem;
    width: 100%;
    min-width: 0;
}

.file-toolbar-row > .explorer-toolbar-menu,
.file-toolbar-row > .file-tool-button {
    flex: 0 0 auto;
}

.file-bulk-actions {
    display: flex !important;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.28rem;
    margin: 0 0 0 0.18rem;
    padding: 0 0 0 0.46rem;
    border-left: 1px solid var(--border);
}

.file-bulk-actions select,
.file-bulk-actions .file-selection-count {
    display: none;
}

.file-bulk-actions.has-selection select,
.file-bulk-actions.has-selection .file-selection-count {
    display: inline-flex;
}

.file-bulk-actions select {
    min-width: 150px;
    max-width: 220px;
    min-height: 34px;
    margin-left: 0.22rem;
    padding-top: .3rem;
    padding-bottom: .3rem;
}

.file-selection-count {
    min-width: auto;
    margin-left: 0.1rem;
    text-align: left;
    white-space: nowrap;
}

/* All four toolbar icons share exactly the same neutral appearance. */
.file-toolbar-row .file-tool-button,
.file-toolbar-row .file-tool-button-primary,
.file-toolbar-row .file-tool-button-danger {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
}

.file-toolbar-row .file-tool-button:not(:disabled):hover,
.file-toolbar-row .file-tool-button:not(:disabled):focus-visible,
.file-toolbar-row .explorer-toolbar-menu[open] > .file-tool-button {
    border-color: var(--border);
    background: var(--card);
    color: var(--primary);
}

.file-toolbar-row .file-tool-button-danger:not(:disabled):hover,
.file-toolbar-row .file-tool-button-danger:not(:disabled):focus-visible {
    color: var(--danger, #b42318);
}

.file-toolbar-row .file-tool-button:disabled {
    opacity: .34;
    background: transparent;
    border-color: transparent;
    cursor: default;
}

/* Native <dialog> lives in the browser top layer, so table rows cannot cover it. */
.explorer-upload-dialog {
    width: min(620px, calc(100vw - 2rem));
    max-width: 620px;
    max-height: calc(100vh - 2rem);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.explorer-upload-dialog::backdrop {
    background: rgba(17, 24, 39, .24);
}

.explorer-upload-dialog-inner {
    position: relative;
    max-height: calc(100vh - 2rem);
    padding: 1rem;
    overflow: auto;
    box-sizing: border-box;
}

.explorer-upload-dialog .file-upload-form {
    padding-top: .15rem;
}

.explorer-upload-dialog .file-upload-close {
    top: .55rem;
    right: .65rem;
}

@media (max-width: 900px) {
    .file-manager-toolbar {
        align-items: center;
        flex-direction: row;
    }

    .file-toolbar-row {
        flex-wrap: nowrap;
    }

    .file-bulk-actions {
        margin-left: 0.18rem;
        padding-left: 0.46rem;
        border-left: 1px solid var(--border);
    }

    .file-selection-count {
        text-align: left;
    }

    .explorer-upload-dialog {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
    }

    .explorer-upload-dialog-inner {
        max-height: calc(100vh - 1rem);
    }
}


/* File manager text actions: simple, robust controls without icon toolbar or modal. */
.file-manager-toolbar {
    display: block;
    min-height: 0;
    padding: .65rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.file-toolbar-text-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem;
}
.file-toolbar-text-actions .button,
.file-toolbar-text-actions button {
    margin: 0;
}
.file-bulk-actions.file-bulk-delete-only {
    display: flex !important;
    align-items: center;
    gap: .55rem;
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
}
.file-bulk-actions.file-bulk-delete-only .file-selection-count {
    display: inline;
    margin: 0;
    color: var(--muted);
    white-space: nowrap;
}
.file-bulk-actions.file-bulk-delete-only button:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.file-action-panel {
    margin: .9rem 0 1rem;
    padding: 1rem;
    position: static;
    z-index: auto;
}
.file-action-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .9rem;
}
.file-action-panel-head h4 {
    margin: 0;
}
.file-action-form {
    max-width: 520px;
}
.file-action-form-actions {
    margin-top: .8rem;
}
.file-action-panel .file-upload-form {
    max-width: 760px;
}
@media (max-width: 700px) {
    .file-toolbar-text-actions {
        align-items: stretch;
    }
    .file-bulk-actions.file-bulk-delete-only {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
        padding-top: .25rem;
    }
}

/* File manager: row actions expand inside the table instead of floating menus. */
.file-row-action-toggle {
    white-space: nowrap;
    padding: 0.38rem 0.65rem;
    font-size: 0.82rem;
}

.file-manager-action-row[hidden] {
    display: none;
}

.file-manager-action-row > td {
    padding: 0 !important;
    background: color-mix(in srgb, var(--card) 92%, var(--bg));
}

.file-manager-action-row:hover > td {
    background: color-mix(in srgb, var(--card) 92%, var(--bg)) !important;
}

.file-manager-action-panel {
    padding: 1rem 1.1rem 1.15rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.file-manager-action-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.file-manager-action-panel-head strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.file-manager-action-panel-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem 1.25rem;
    align-items: end;
}

.file-manager-file-actions {
    grid-template-columns: auto minmax(280px, 1fr) auto;
    align-items: start;
}

.file-manager-edit-form {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 0.8fr);
    gap: 0.55rem 0.75rem;
    align-items: end;
}

.file-manager-edit-form label {
    margin: 0;
}

.file-manager-edit-form label:nth-of-type(3),
.file-manager-edit-form textarea,
.file-manager-edit-form button {
    grid-column: 1 / -1;
}

.file-manager-edit-form button {
    justify-self: start;
}

.file-manager-download-action,
.file-manager-delete-form {
    margin: 0;
}

.file-manager-delete-form {
    align-self: end;
}

@media (max-width: 850px) {
    .file-manager-action-panel-body,
    .file-manager-file-actions,
    .file-manager-edit-form {
        grid-template-columns: 1fr;
    }

    .file-manager-edit-form label:nth-of-type(3),
    .file-manager-edit-form textarea,
    .file-manager-edit-form button {
        grid-column: auto;
    }
}

.client-calendar-color {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-right: .45rem;
    border: 1px solid rgba(15, 23, 42, .2);
    border-radius: 50%;
    background: var(--client-calendar-color, #1D4ED8);
    vertical-align: -.15rem;
}
