/**
 * @file
 * Digital Asset Inventory - Admin Styles
 *
 * Admin-specific styles for inventory, archive management, and settings.
 * Used on admin pages only (e.g., /admin/digital-asset-inventory/*).
 *
 * CSS Scoping:
 * - Admin views use the .dai--admin wrapper class for theme override support.
 * - View-specific selectors (.view-digital-assets, .view-id-digital_assets)
 *   provide additional specificity when needed.
 *
 * ============================================================================
 * THEME OVERRIDE GUIDE
 * ============================================================================
 *
 * This module is designed to work with any Drupal admin theme (Claro, Seven,
 * Gin, etc.). All colors use CSS variables defined in dai-base.css, making
 * customization straightforward.
 *
 * METHOD 1: Override CSS Variables (Recommended)
 * -----------------------------------------------
 * Add to your theme's CSS file to change colors globally:
 *
 *   :root {
 *     --dai-surface-bg: var(--gin-bg-secondary, #f5f5f5);
 *     --dai-accent-info: var(--gin-color-primary, #003ecc);
 *     --dai-badge-danger-bg: var(--gin-color-danger, #d72222);
 *   }
 *
 * Available variables (defined in dai-base.css):
 *   --dai-surface-bg          Background for info boxes, cards
 *   --dai-surface-border      Border color for dividers
 *   --dai-surface-radius      Border radius for containers
 *   --dai-accent-info         Left border accent color
 *   --dai-text-muted          Secondary/muted text color
 *   --dai-badge-info-bg       Info badges (blue)
 *   --dai-badge-success-bg    Success badges (green)
 *   --dai-badge-warning-bg    Warning badges (yellow)
 *   --dai-badge-danger-bg     Danger badges (red)
 *   --dai-badge-neutral-bg    Neutral badges (gray)
 *   --dai-btn-secondary-*     Secondary button colors
 *   --dai-btn-intentional-*   Intentional action button colors
 *   --dai-btn-danger-*        Danger button colors
 *
 * METHOD 2: Extend the Library
 * ----------------------------
 * Add to your theme's .info.yml to load additional CSS after the module:
 *
 *   libraries-extend:
 *     digital_asset_inventory/admin:
 *       - mytheme/dai_admin_overrides
 *
 * Then create css/dai_admin_overrides.css in your theme:
 *
 *   .dai--admin .digital-asset-scan-info {
 *     background-color: var(--gin-bg-secondary);
 *     border-left-color: var(--gin-color-primary);
 *   }
 *
 * METHOD 3: Direct Selector Override
 * ----------------------------------
 * Use .dai--admin prefix for specificity:
 *
 *   .dai--admin .dai-badge--filesystem_only {
 *     background-color: #custom-color;
 *   }
 *
 * ============================================================================
 */

/* ===== Toolbar Icon ===== */
/* Archive icon for Digital Asset Inventory toolbar menu item */
.toolbar-icon-digital-asset-inventory-view::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3e%3cpath fill='%23787878' d='M14 2H2c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zM8 12H3V9h5v3zm0-4H3V5h5v3zm5 4H9V9h4v3zm0-4H9V5h4v3z'/%3e%3c/svg%3e");
}

.toolbar-icon-digital-asset-inventory-view:active::before,
.toolbar-icon-digital-asset-inventory-view.is-active::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3e%3cpath fill='%23000000' d='M14 2H2c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zM8 12H3V9h5v3zm0-4H3V5h5v3zm5 4H9V9h4v3zm0-4H9V5h4v3z'/%3e%3c/svg%3e");
}

/* ===== Error Message (Drupal Core Alert Style) ===== */
/* Custom styles for the important error/warning message */
.view-header .messages--error {
  margin-bottom: 1.5rem;
}

.view-header .messages--error strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.view-header .messages--error p {
  margin: 0.5rem 0;
  line-height: 1.5;
}

.view-header .messages--error p:last-of-type {
  margin-bottom: 0;
}

/* ===== Scan Info Box ===== */
.digital-asset-scan-info {
  background-color: var(--dai-surface-bg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: var(--dai-surface-radius);
  border-left: 3px solid var(--dai-accent-info);
}

.digital-asset-scan-info p {
  margin: 0.25rem 0;
}

.digital-asset-scan-info .scan-limitations-note {
  font-size: 1.05em;
  margin-bottom: 0.75rem;
}

/* Mobile: Stack buttons and add spacing */
@media (max-width: 768px) {
  .digital-asset-scan-info p:last-child {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .digital-asset-scan-info .button {
    display: block;
    text-align: center;
  }
}

/* Header area - no additional border since we style the inner elements */
.view-digital-assets .view-header {
  margin-bottom: 0.5rem;
}

/* ===== Digital Assets Inventory View ===== */
/* Exposed filter form container */
.view-digital-assets .views-exposed-form {
  margin-bottom: 2rem;
}

/* Filter form items - stack on mobile, inline on desktop */
.view-digital-assets .views-exposed-form .form-item {
  display: block;
  margin-bottom: 1rem;
}

/* Form actions */
.view-digital-assets .views-exposed-form .form-actions {
  margin-top: 1rem;
}

@media (min-width: 1024px) {
  .view-digital-assets .views-exposed-form .form-item {
    display: inline-block;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    vertical-align: top;
  }

  .view-digital-assets .views-exposed-form .form-actions {
    display: inline-block;
    vertical-align: top;
    margin-top: 1.6rem;
  }
}

/* Category grouping headers - style caption as h2 */
.view-digital-assets caption {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--dai-surface-border);
  text-align: left;
  caption-side: top;
}

.view-digital-assets table:first-of-type caption {
  margin-top: 0;
}

/* Style optgroup labels in filter dropdown */
.view-digital-assets .views-exposed-form select optgroup {
  font-weight: bold;
  font-style: normal;
  background-color: var(--dai-surface-bg);
}

/* Asset link - allow wrapping for long URLs */
.view-digital-assets .asset-link {
  display: inline;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ===== Badge Styles for Source Type ===== */
/*
 * Badges use 5 semantic colors:
 * - Info (blue): file_managed, media_managed
 * - Danger (red): filesystem_only
 * - Success (green): external
 * - Warning (yellow): queued
 * - Neutral (gray): archived_deleted
 */
.dai-badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 3px;
  white-space: nowrap;
}

/* Info badges (blue) - managed files */
.dai-badge--file_managed,
.dai-badge--media_managed {
  background-color: var(--dai-badge-info-bg);
  color: #fff;
}

/* Success badges (green) - external resources */
.dai-badge--external {
  background-color: var(--dai-badge-success-bg);
  color: #fff;
}

/* Danger badges (red) - manual uploads requiring attention */
.dai-badge--filesystem_only {
  background-color: var(--dai-badge-danger-bg);
  color: #fff;
}

/* ===== Row Indicator System ===== */
/*
 * Row indicators reserved for critical/error states only.
 * - Inventory view: No row indicators (badges + text communicate status)
 * - Archive view: Critical states only (red status rail)
 *
 * Design rationale:
 * - Row styling should not look like clickable buttons
 * - Advisory/informational states use badges and text
 * - Critical states use a thin "status rail" (inset box-shadow)
 */

/* Row indicators removed - status badges provide sufficient visual indication */
/* Previously used box-shadow inset for critical rows, but this was redundant with badges */

/* Usage count styling */
.dai-usage-none {
  color: var(--dai-text-muted);
  font-style: italic;
}

/* ===== Table Structural Overrides ===== */
/* Let themes handle row colors and header styling. Module provides structure only. */

/* WCAG 2.5.5: Ensure sortable table headers meet 44px minimum touch target */
.dai--admin table.views-table thead th {
  min-height: 44px;
}

.dai--admin table.views-table thead th a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: 0.5rem;
}

/* Operations column - adequate spacing for touch targets (WCAG 2.5.8 Level AA: 24px) */
/* Note: 44px is Level AAA; inline controls in tables have spacing exceptions */
@media (min-width: 1024px) {
  .dai--admin .views-field-operations .dropbutton-widget {
    white-space: nowrap;
  }
}

/* Hide File URL column on page display - it's only needed for CSV export */
.view-id-digital_assets .views-field-file-path,
.view-id-digital_assets th.views-field-file-path {
  display: none;
}

/* ===== Table Column Alignment (Desktop Only) ===== */
/* Fixed layout only on larger screens (1024px+) - ensures reflow at 400% zoom */
/* 1024px breakpoint = mobile layout up to 4096px screens at 400% zoom */
@media (min-width: 1024px) {
  .view-id-digital_assets {
    --col-name: clamp(260px, 34%, 520px);
    --col-mime: clamp(110px, 12%, 200px);
    --col-size: clamp(70px, 8%, 120px);
    --col-source: clamp(140px, 14%, 260px);
    --col-used: clamp(80px, 8%, 120px);
    --col-ops: clamp(160px, 18%, 240px);
  }

  .view-id-digital_assets table.views-table {
    table-layout: fixed;
    width: 100%;
  }

  /* Apply consistent widths to all table headers and cells */
  .view-id-digital_assets thead th:nth-child(1),
  .view-id-digital_assets tbody td:nth-child(1) {
    width: var(--col-name);
  }

  .view-id-digital_assets thead th:nth-child(2),
  .view-id-digital_assets tbody td:nth-child(2) {
    width: var(--col-mime);
  }

  .view-id-digital_assets thead th:nth-child(3),
  .view-id-digital_assets tbody td:nth-child(3) {
    width: var(--col-size);
  }

  .view-id-digital_assets thead th:nth-child(4),
  .view-id-digital_assets tbody td:nth-child(4) {
    width: var(--col-source);
  }

  .view-id-digital_assets thead th:nth-child(5),
  .view-id-digital_assets tbody td:nth-child(5) {
    width: var(--col-used);
  }

  .view-id-digital_assets thead th:nth-child(6),
  .view-id-digital_assets tbody td:nth-child(6) {
    width: var(--col-ops);
  }

  /* Truncate long file names on desktop to keep layout stable */
  .view-id-digital_assets td.views-field-file-name {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Ensure Operations column buttons don't wrap on desktop */
  .view-id-digital_assets td.views-field-operations {
    white-space: nowrap;
  }
}

/* Responsive table container */
.view-id-digital_assets .view-content {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Allow text wrapping for long content */
.view-id-digital_assets td,
.view-id-digital_assets th {
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

/* ===== Tablesaw Stacked Mode (Mobile: 640px and below) ===== */
/* Standard mobile breakpoint - Tablesaw handles stacking via JS */
@media (max-width: 640px) {
  .dai--admin table.views-table {
    display: block !important;
    table-layout: auto !important;
    width: 100% !important;
  }

  /* Force block display on all table elements */
  .dai--admin .tablesaw-stack,
  .dai--admin .tablesaw-stack thead,
  .dai--admin .tablesaw-stack tbody,
  .dai--admin .tablesaw-stack tr,
  .dai--admin .tablesaw-stack th {
    display: block !important;
    width: 100% !important;
  }

  .dai--admin .tablesaw-stack tbody tr {
    display: block !important;
    position: relative !important;
    border-bottom: 2px solid var(--dai-surface-border);
    margin-bottom: 1rem;
    padding: 0.5rem 0;
  }

  /* Block display - theme agnostic approach */
  .dai--admin .tablesaw-stack td {
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    position: static !important;
    white-space: normal !important;
    overflow: visible !important;
    box-sizing: border-box;
    padding: 0.5rem 0 !important;
    margin: 0 !important;
    line-height: 1.4;
  }

  /* Clearfix for td - ensures cell expands to contain floated children */
  .dai--admin .tablesaw-stack td::before,
  .dai--admin .tablesaw-stack td::after {
    content: " " !important;
    display: table !important;
  }
  .dai--admin .tablesaw-stack td::after {
    clear: both !important;
  }

  /* Reset Tablesaw's float-based layout */
  .dai--admin .tablesaw-stack td .tablesaw-cell-label,
  .dai--admin .tablesaw-stack td .tablesaw-cell-content {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    position: static !important;
    height: auto !important;
    margin: 0 !important;
  }

  .dai--admin .tablesaw-stack td .tablesaw-cell-label {
    font-weight: 700;
    margin-bottom: 0.25rem;
  }

  .dai--admin .tablesaw-stack td .tablesaw-cell-content {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .dai--admin .tablesaw-stack td.views-field-file-name {
    word-break: break-word;
    overflow-wrap: anywhere;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--dai-surface-border);
  }

  .dai--admin .tablesaw-stack td.views-field-file-path,
  .dai--admin .tablesaw-stack th.views-field-file-path {
    display: none !important;
  }

  .dai--admin .tablesaw-stack .asset-link {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
  }

  /* Operations cell - no borders, extra bottom padding for multiple links */
  .dai--admin .tablesaw-stack td.views-field-operations {
    width: 100% !important;
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    padding-bottom: 1rem;
    border: 0 !important;
  }

  /* Remove all borders from operations cell descendants */
  .dai--admin .tablesaw-stack td.views-field-operations *,
  .dai--admin .tablesaw-stack td.views-field-operations *::before,
  .dai--admin .tablesaw-stack td.views-field-operations *::after {
    border: 0 !important;
    box-shadow: none !important;
  }

  /* Mobile: Show operations as simple stacked links (no dropbutton styling) */
  .dai--admin .tablesaw-stack .dropbutton-wrapper,
  .dai--admin .tablesaw-stack .dropbutton-widget,
  .dai--admin .tablesaw-stack .dropbutton {
    all: unset !important;
    display: block !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hide the toggle button */
  .dai--admin .tablesaw-stack .dropbutton-toggle,
  .dai--admin .tablesaw-stack .dropbutton__toggle {
    display: none !important;
  }

  /* Reset all list items - target both old and new BEM classes */
  .dai--admin .tablesaw-stack .dropbutton li,
  .dai--admin .tablesaw-stack .dropbutton > li,
  .dai--admin .tablesaw-stack .dropbutton-action,
  .dai--admin .tablesaw-stack .dropbutton__item {
    all: unset !important;
    display: block !important;
    background: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  /* Remove any pseudo-element separators */
  .dai--admin .tablesaw-stack .dropbutton li::before,
  .dai--admin .tablesaw-stack .dropbutton li::after,
  .dai--admin .tablesaw-stack .dropbutton__item::before,
  .dai--admin .tablesaw-stack .dropbutton__item::after {
    display: none !important;
    content: none !important;
  }

  /* Style all action links */
  .dai--admin .tablesaw-stack .dropbutton li a,
  .dai--admin .tablesaw-stack .dropbutton__item a {
    display: inline-block !important;
    padding: 0.5rem 0.5rem 0.5rem 0 !important;
    text-decoration: underline !important;
    color: var(--dai-accent-info, #003ecc) !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
  }

  /* Hover state */
  .dai--admin .tablesaw-stack .dropbutton li a:hover,
  .dai--admin .tablesaw-stack .dropbutton__item a:hover {
    color: var(--dai-accent-info-hover, #002d99) !important;
    text-decoration-thickness: 2px !important;
  }

  /* Focus state for keyboard navigation */
  .dai--admin .tablesaw-stack .dropbutton li a:focus,
  .dai--admin .tablesaw-stack .dropbutton__item a:focus {
    outline: 2px solid var(--dai-accent-info, #003ecc) !important;
    outline-offset: 2px !important;
  }

  /* Active/pressed state */
  .dai--admin .tablesaw-stack .dropbutton li a:active,
  .dai--admin .tablesaw-stack .dropbutton__item a:active {
    color: var(--dai-accent-info-active, #001f66) !important;
  }
}

/* ===== CSS Stacked Mode (Tablet/Zoom: 641px to 1023px) ===== */
/* For larger screens at 400% zoom where Tablesaw doesn't activate */
/* Provides WCAG 1.4.10 reflow support */
/* Card-based layout matching public archive registry */
@media (min-width: 641px) and (max-width: 1023px) {
  .dai--admin table.views-table {
    table-layout: auto !important;
    border: 0 !important;
  }

  /* Hide table header - show labels per cell */
  .dai--admin table.views-table thead {
    display: none;
  }

  /* Force block display on tbody */
  .dai--admin table.views-table tbody {
    display: block;
  }

  /* Each row becomes a card */
  .dai--admin table.views-table tbody tr {
    display: block;
    border: 1px solid var(--dai-surface-border);
    border-radius: var(--dai-surface-radius);
    margin-bottom: 1rem;
    padding: 0;
    background-color: var(--dai-surface-bg-alt);
  }

  /* Each cell becomes a block with separator */
  .dai--admin table.views-table td {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    box-sizing: border-box;
    padding: 0.75rem !important;
    border: none !important;
    border-bottom: 1px solid var(--dai-surface-border) !important;
    text-align: left !important;
    line-height: 1.4;
  }

  /* Last cell - no bottom border */
  .dai--admin table.views-table td:last-child {
    border-bottom: none !important;
  }

  /* Labels using column classes */
  .dai--admin table.views-table td.views-field-file-name::before {
    content: "File Name";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .dai--admin table.views-table td.views-field-mime-type::before {
    content: "Type";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .dai--admin table.views-table td.views-field-filesize::before {
    content: "Size";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .dai--admin table.views-table td.views-field-source-type::before {
    content: "Source";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .dai--admin table.views-table td.views-field-used-in::before {
    content: "Used In";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .dai--admin table.views-table td.views-field-operations::before,
  .dai--admin table.views-table td.views-field-nothing::before {
    content: "Operations";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }

  /* Operations cell - last in card, no bottom border */
  .dai--admin table.views-table td.views-field-operations {
    border-bottom: none !important;
  }

  /* Remove all borders from operations cell descendants */
  .dai--admin table.views-table td.views-field-operations *,
  .dai--admin table.views-table td.views-field-operations *::before,
  .dai--admin table.views-table td.views-field-operations *::after {
    border: 0 !important;
    box-shadow: none !important;
  }

  /* File name field - word wrapping */
  .dai--admin table.views-table td.views-field-file-name {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* Keep File URL column hidden (CSV export only) */
  .dai--admin table.views-table td.views-field-file-path {
    display: none !important;
  }

  /* Asset links - force wrapping */
  .dai--admin table.views-table .asset-link {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
  }

  /* Operations column - proper padding in card layout */
  .dai--admin table.views-table td.views-field-operations,
  .dai--admin table.views-table td.views-field-nothing {
    padding: 0.75rem !important;
    border-bottom: none !important;
  }

  /* Show operations as simple stacked links (no dropbutton styling) */
  .dai--admin table.views-table .dropbutton-wrapper,
  .dai--admin table.views-table .dropbutton-widget,
  .dai--admin table.views-table .dropbutton {
    all: unset !important;
    display: block !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hide the toggle button */
  .dai--admin table.views-table .dropbutton-toggle,
  .dai--admin table.views-table .dropbutton__toggle {
    display: none !important;
  }

  /* Reset all list items - target both old and new BEM classes */
  .dai--admin table.views-table .dropbutton li,
  .dai--admin table.views-table .dropbutton > li,
  .dai--admin table.views-table .dropbutton-action,
  .dai--admin table.views-table .dropbutton__item {
    all: unset !important;
    display: block !important;
    background: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  /* Remove any pseudo-element separators */
  .dai--admin table.views-table .dropbutton li::before,
  .dai--admin table.views-table .dropbutton li::after,
  .dai--admin table.views-table .dropbutton__item::before,
  .dai--admin table.views-table .dropbutton__item::after {
    display: none !important;
    content: none !important;
  }

  /* Style all action links */
  .dai--admin table.views-table .dropbutton li a,
  .dai--admin table.views-table .dropbutton__item a {
    display: inline-block !important;
    padding: 0.5rem 0.5rem 0.5rem 0 !important;
    text-decoration: underline !important;
    color: var(--dai-accent-info, #003ecc) !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
  }

  /* Hover state */
  .dai--admin table.views-table .dropbutton li a:hover,
  .dai--admin table.views-table .dropbutton__item a:hover {
    color: var(--dai-accent-info-hover, #002d99) !important;
    text-decoration-thickness: 2px !important;
  }

  /* Focus state for keyboard navigation */
  .dai--admin table.views-table .dropbutton li a:focus,
  .dai--admin table.views-table .dropbutton__item a:focus {
    outline: 2px solid var(--dai-accent-info, #003ecc) !important;
    outline-offset: 2px !important;
  }

  /* Active/pressed state */
  .dai--admin table.views-table .dropbutton li a:active,
  .dai--admin table.views-table .dropbutton__item a:active {
    color: var(--dai-accent-info-active, #001f66) !important;
  }
}

/* ===== Archive Management Styles ===== */

/* Status label styling - badge style */
/*
 * Status labels use semantic colors:
 * - Warning (yellow): queued
 * - Success (green): archived_public, archived_admin
 * - Neutral (gray): archived_deleted
 * - Danger (red): exemption_void
 */
.dai-status-label {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 3px;
  white-space: nowrap;
  background-color: var(--dai-badge-neutral-bg);
  color: #fff;
}

.dai-status-label--queued {
  background-color: var(--dai-badge-warning-bg);
  color: #000;
}

.dai-status-label--archived,
.dai-status-label--archived_public,
.dai-status-label--archived_admin {
  background-color: var(--dai-badge-success-bg);
  color: #fff;
}

.dai-status-label--archived_deleted {
  background-color: var(--dai-badge-neutral-bg);
  color: #fff;
}

.dai-status-label--exemption_void {
  background-color: var(--dai-badge-danger-bg);
  color: #fff;
}

/* Warning Badges - outlined style to differentiate from status badges */
/*
 * Status badges use solid fills to indicate lifecycle state;
 * Warning badges use outlined styles to indicate detected issues
 * without overriding status severity.
 *
 * - Critical (red outline): missing, integrity, usage, modified
 * - Advisory (yellow outline): late
 */
.dai-warning-badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 3px;
  white-space: nowrap;
  margin-right: 4px;
  margin-bottom: 4px;
  background-color: transparent;
  border-width: 1px;
  border-style: solid;
}

/* Critical warning badges (red outline) - problem detected */
.dai-warning-badge--usage,
.dai-warning-badge--missing,
.dai-warning-badge--integrity,
.dai-warning-badge--modified {
  border-color: var(--dai-badge-danger-bg);
  color: var(--dai-badge-danger-bg);
}

/* Advisory warning badges (yellow outline) - informational */
.dai-warning-badge--late,
.dai-warning-badge--prior-void {
  border-color: var(--dai-badge-advisory-border);
  color: var(--dai-badge-advisory-text);
}

/* No warnings placeholder */
.dai-no-warnings {
  color: var(--dai-text-muted);
  font-style: italic;
}

/* ===== Archive Badges (for inventory view) ===== */
/*
 * Archive badges use semantic colors:
 * - Success (green): public, admin
 * - Neutral (gray): deleted
 * - Warning (yellow): queued, modified
 * - Danger (red): exemption_void
 */
.dai-archive-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 3px;
  white-space: nowrap;
  margin-left: 6px;
  vertical-align: middle;
}

.dai-archive-badge--public,
.dai-archive-badge--admin {
  background-color: var(--dai-badge-success-bg);
  color: #fff;
}

.dai-archive-badge--deleted {
  background-color: var(--dai-badge-neutral-bg);
  color: #fff;
}

.dai-archive-badge--queued,
.dai-archive-badge--modified {
  background-color: var(--dai-badge-warning-bg);
  color: #000;
}

.dai-archive-badge--exemption_void,
.dai-archive-badge--void {
  background-color: var(--dai-badge-danger-bg);
  color: #fff;
}

/* ===== Hide filters when views are empty ===== */
/* When the view shows the empty area, hide the exposed form */
.view-digital-assets:has(.view-empty) .views-exposed-form,
.view-digital-asset-archive:has(.view-empty) .views-exposed-form {
  display: none;
}

/* ===== Archive Views Responsive Tables ===== */

/* Archive & public archive tables - desktop defaults */
.view-digital-asset-archive .view-content {
  overflow-x: visible; /* no horizontal scroll on desktop */
}

/* Let the table size naturally and fill the container */
.view-digital-asset-archive table.views-table {
  table-layout: auto;
  width: 100%;
}

/* Allow text wrapping for long content */
.view-digital-asset-archive td,
.view-digital-asset-archive th {
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

/* Let dropbutton size within the column instead of forcing the table wider */
.view-digital-asset-archive .dropbutton-wrapper,
.view-digital-asset-archive .dropbutton-widget {
  min-width: 0;
}

/* Archive view desktop-only styles */
@media (min-width: 1024px) {
  /* Truncate long file names in archive views */
  .view-digital-asset-archive td.views-field-file-name {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Ensure Operations column buttons have enough space and stay on one line */
  .view-digital-asset-archive td.views-field-operations,
  .view-digital-asset-archive th.views-field-operations {
    width: 180px;
    white-space: nowrap;
  }
}

/* Archive view Tablesaw stacked mode (Mobile: 640px and below) */
@media (max-width: 640px) {
  .view-digital-asset-archive table.views-table {
    display: block !important;
    width: 100% !important;
  }

  /* Force block display on all table elements */
  .view-digital-asset-archive .tablesaw-stack,
  .view-digital-asset-archive .tablesaw-stack thead,
  .view-digital-asset-archive .tablesaw-stack tbody,
  .view-digital-asset-archive .tablesaw-stack tr,
  .view-digital-asset-archive .tablesaw-stack th {
    display: block !important;
    width: 100% !important;
    border: 0 !important;
  }

  .view-digital-asset-archive .tablesaw-stack tbody tr {
    display: block !important;
    position: relative !important;
    border-bottom: 2px solid var(--dai-surface-border) !important;
    margin-bottom: 2rem;
    padding: 0.5rem 0 1.5rem 0;
  }

  /* Block display - theme agnostic approach */
  .view-digital-asset-archive .tablesaw-stack td {
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    position: static !important;
    white-space: normal !important;
    overflow: visible !important;
    box-sizing: border-box;
    padding: 0.5rem 0 !important;
    margin: 0 !important;
    line-height: 1.4;
    border: 0 !important;
  }

  /* Clearfix for td - ensures cell expands to contain floated children */
  .view-digital-asset-archive .tablesaw-stack td::before,
  .view-digital-asset-archive .tablesaw-stack td::after {
    content: " " !important;
    display: table !important;
  }
  .view-digital-asset-archive .tablesaw-stack td::after {
    clear: both !important;
  }

  /* Reset Tablesaw's float-based layout */
  .view-digital-asset-archive .tablesaw-stack td .tablesaw-cell-label,
  .view-digital-asset-archive .tablesaw-stack td .tablesaw-cell-content {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    position: static !important;
    height: auto !important;
    border: 0 !important;
    margin: 0 !important;
  }

  .view-digital-asset-archive .tablesaw-stack td .tablesaw-cell-label {
    font-weight: 700;
    margin-bottom: 0.25rem;
  }

  .view-digital-asset-archive .tablesaw-stack td .tablesaw-cell-content {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .view-digital-asset-archive .tablesaw-stack td.views-field-file-name {
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--dai-surface-border) !important;
  }

  /* Operations cell - no borders, extra bottom padding for multiple links */
  .view-digital-asset-archive .tablesaw-stack td.views-field-operations {
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    padding-bottom: 1rem;
    border: 0 !important;
  }

  /* Remove all borders from operations cell descendants */
  .view-digital-asset-archive .tablesaw-stack td.views-field-operations *,
  .view-digital-asset-archive .tablesaw-stack td.views-field-operations *::before,
  .view-digital-asset-archive .tablesaw-stack td.views-field-operations *::after {
    border: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
  }

  /* Mobile: Show operations as simple stacked links (no dropbutton styling) */
  .view-digital-asset-archive .tablesaw-stack .dropbutton-wrapper,
  .view-digital-asset-archive .tablesaw-stack .dropbutton-widget,
  .view-digital-asset-archive .tablesaw-stack .dropbutton {
    all: unset !important;
    display: block !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hide the toggle button */
  .view-digital-asset-archive .tablesaw-stack .dropbutton-toggle,
  .view-digital-asset-archive .tablesaw-stack .dropbutton__toggle {
    display: none !important;
  }

  /* Reset all list items - target both old and new BEM classes */
  .view-digital-asset-archive .tablesaw-stack .dropbutton li,
  .view-digital-asset-archive .tablesaw-stack .dropbutton > li,
  .view-digital-asset-archive .tablesaw-stack .dropbutton-action,
  .view-digital-asset-archive .tablesaw-stack .dropbutton__item {
    all: unset !important;
    display: block !important;
    background: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  /* Remove any pseudo-element separators */
  .view-digital-asset-archive .tablesaw-stack .dropbutton li::before,
  .view-digital-asset-archive .tablesaw-stack .dropbutton li::after,
  .view-digital-asset-archive .tablesaw-stack .dropbutton__item::before,
  .view-digital-asset-archive .tablesaw-stack .dropbutton__item::after {
    display: none !important;
    content: none !important;
  }

  /* Style all action links */
  .view-digital-asset-archive .tablesaw-stack .dropbutton li a,
  .view-digital-asset-archive .tablesaw-stack .dropbutton__item a {
    display: inline-block !important;
    padding: 0.5rem 0.5rem 0.5rem 0 !important;
    text-decoration: underline !important;
    color: var(--dai-accent-info, #003ecc) !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
  }

  /* Hover state */
  .view-digital-asset-archive .tablesaw-stack .dropbutton li a:hover,
  .view-digital-asset-archive .tablesaw-stack .dropbutton__item a:hover {
    color: var(--dai-accent-info-hover, #002d99) !important;
    text-decoration-thickness: 2px !important;
  }

  /* Focus state for keyboard navigation */
  .view-digital-asset-archive .tablesaw-stack .dropbutton li a:focus,
  .view-digital-asset-archive .tablesaw-stack .dropbutton__item a:focus {
    outline: 2px solid var(--dai-accent-info, #003ecc) !important;
    outline-offset: 2px !important;
  }

  /* Active/pressed state */
  .view-digital-asset-archive .tablesaw-stack .dropbutton li a:active,
  .view-digital-asset-archive .tablesaw-stack .dropbutton__item a:active {
    color: var(--dai-accent-info-active, #001f66) !important;
  }
}

/* Archive view CSS stacked mode (Tablet/Zoom: 641px to 1023px) */
/* Card-based layout matching public archive registry */
@media (min-width: 641px) and (max-width: 1023px) {
  .view-digital-asset-archive table.views-table {
    table-layout: auto !important;
    border: 0 !important;
  }

  .view-digital-asset-archive table.views-table thead {
    display: none;
  }

  /* Force block display on tbody */
  .view-digital-asset-archive table.views-table tbody {
    display: block;
  }

  /* Each row becomes a card */
  .view-digital-asset-archive table.views-table tbody tr {
    display: block;
    border: 1px solid var(--dai-surface-border);
    border-radius: var(--dai-surface-radius);
    margin-bottom: 1rem;
    padding: 0;
    background-color: var(--dai-surface-bg-alt);
  }

  /* Each cell becomes a block with separator */
  .view-digital-asset-archive table.views-table td {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    box-sizing: border-box;
    padding: 0.75rem !important;
    border: none !important;
    border-bottom: 1px solid var(--dai-surface-border) !important;
    text-align: left !important;
    line-height: 1.4;
  }

  /* Last cell - no bottom border */
  .view-digital-asset-archive table.views-table td:last-child {
    border-bottom: none !important;
  }

  /* Labels for archive view columns */
  .view-digital-asset-archive table.views-table td.views-field-file-name::before {
    content: "File Name";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-archive table.views-table td.views-field-archive-type::before {
    content: "Archive Type";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-archive table.views-table td.views-field-asset-type::before {
    content: "Type";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-archive table.views-table td.views-field-status::before {
    content: "Status";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-archive table.views-table td.views-field-archive-reason::before {
    content: "Purpose";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-archive table.views-table td.views-field-warnings::before {
    content: "Warnings";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-archive table.views-table td.views-field-notes-link::before {
    content: "Internal Notes";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-archive table.views-table td.views-field-created::before {
    content: "Archive Queued Date";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-archive table.views-table td.views-field-archived-by::before {
    content: "Archived By";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-archive table.views-table td.views-field-archive-classification-date::before {
    content: "Archive Classification Date";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-archive table.views-table td.views-field-operations::before {
    content: "Operations";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }

  .view-digital-asset-archive table.views-table td.views-field-file-name {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* Operations cell - last in card, no bottom border */
  .view-digital-asset-archive table.views-table td.views-field-operations {
    border-bottom: none !important;
  }

  /* Remove all borders from operations cell descendants */
  .view-digital-asset-archive table.views-table td.views-field-operations *,
  .view-digital-asset-archive table.views-table td.views-field-operations *::before,
  .view-digital-asset-archive table.views-table td.views-field-operations *::after {
    border: 0 !important;
    box-shadow: none !important;
  }

  .view-digital-asset-archive table.views-table .asset-link {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
  }

  /* Show operations as simple stacked links (no dropbutton styling) */
  .view-digital-asset-archive table.views-table .dropbutton-wrapper,
  .view-digital-asset-archive table.views-table .dropbutton-widget,
  .view-digital-asset-archive table.views-table .dropbutton {
    all: unset !important;
    display: block !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hide the toggle button */
  .view-digital-asset-archive table.views-table .dropbutton-toggle,
  .view-digital-asset-archive table.views-table .dropbutton__toggle {
    display: none !important;
  }

  /* Reset all list items - target both old and new BEM classes */
  .view-digital-asset-archive table.views-table .dropbutton li,
  .view-digital-asset-archive table.views-table .dropbutton > li,
  .view-digital-asset-archive table.views-table .dropbutton-action,
  .view-digital-asset-archive table.views-table .dropbutton__item {
    all: unset !important;
    display: block !important;
    background: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  /* Remove any pseudo-element separators */
  .view-digital-asset-archive table.views-table .dropbutton li::before,
  .view-digital-asset-archive table.views-table .dropbutton li::after,
  .view-digital-asset-archive table.views-table .dropbutton__item::before,
  .view-digital-asset-archive table.views-table .dropbutton__item::after {
    display: none !important;
    content: none !important;
  }

  /* Style all action links */
  .view-digital-asset-archive table.views-table .dropbutton li a,
  .view-digital-asset-archive table.views-table .dropbutton__item a {
    display: inline-block !important;
    padding: 0.5rem 0.5rem 0.5rem 0 !important;
    text-decoration: underline !important;
    color: var(--dai-accent-info, #003ecc) !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
  }

  /* Hover state */
  .view-digital-asset-archive table.views-table .dropbutton li a:hover,
  .view-digital-asset-archive table.views-table .dropbutton__item a:hover {
    color: var(--dai-accent-info-hover, #002d99) !important;
    text-decoration-thickness: 2px !important;
  }

  /* Focus state for keyboard navigation */
  .view-digital-asset-archive table.views-table .dropbutton li a:focus,
  .view-digital-asset-archive table.views-table .dropbutton__item a:focus {
    outline: 2px solid var(--dai-accent-info, #003ecc) !important;
    outline-offset: 2px !important;
  }

  /* Active/pressed state */
  .view-digital-asset-archive table.views-table .dropbutton li a:active,
  .view-digital-asset-archive table.views-table .dropbutton__item a:active {
    color: var(--dai-accent-info-active, #001f66) !important;
  }
}

/* ===== Link Accessibility ===== */
/* Ensure links have underlines as secondary visual identifier (not just color) */

/* Archive management page links (admin) */
.view-digital-asset-archive .view-header a:link,
.view-digital-asset-archive .view-header a:visited {
  text-decoration: underline;
}

.view-digital-asset-archive .view-header a:hover,
.view-digital-asset-archive .view-header a:focus {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Exclude button-styled links from underline */
.view-digital-asset-archive .view-header a.button {
  text-decoration: none;
}

.view-digital-asset-archive .view-header a.button:hover,
.view-digital-asset-archive .view-header a.button:focus {
  text-decoration: none;
}

/* ===== Archive Warning Text ===== */
.archive-warning {
  color: var(--dai-badge-danger-bg);
}

/* ===== Archive Options - Side-by-Side Bordered Boxes ===== */
.archive-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 48rem) {
  .archive-options {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.archive-option {
  background-color: var(--dai-surface-bg);
  padding: 1rem 1.25rem;
  border-radius: var(--dai-surface-radius);
  border-left: 3px solid var(--dai-accent-info);
}

.archive-option h3 {
  margin-top: 0;
}

.archive-option p {
  margin-bottom: 0.75rem;
}

.archive-option:focus-within {
  outline: 2px solid var(--dai-accent-info);
  outline-offset: 2px;
}

/* ===== Archive Asset Form - File Info Container ===== */
/* Light, read-only container for file information display */
.file-info-container {
  background-color: var(--dai-surface-bg);
  padding: 0.75rem 1rem;
  border-radius: var(--dai-surface-radius);
  border: 1px solid var(--dai-surface-border);
  margin-bottom: 1.5rem;
}

.file-info-container h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.file-info-container ul {
  margin: 0;
  padding-left: 1.25rem;
}

.file-info-container li {
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.file-info-container a {
  word-break: break-all;
}

/* Archive details section label */
.archive-details-label {
  margin: 1.5rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--dai-surface-border);
  font-size: 1.1rem;
}

/* Helper text above form actions */
.form-actions-helper {
  color: var(--dai-text-muted);
  font-size: 0.9em;
  margin-bottom: 0.5rem;
}

/* Archive validation panel (execute archive form) */
.archive-validation-panel {
  background-color: var(--dai-surface-bg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: var(--dai-surface-radius);
  border-left: 3px solid var(--dai-badge-success-bg);
}

.archive-validation-panel p:first-child {
  margin-top: 0;
}

.archive-validation-panel ul {
  margin: 0.75rem 0;
  padding-left: 0;
  list-style: none;
}

.archive-validation-panel ul li {
  margin-bottom: 0.25rem;
}

.archive-validation-note {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--dai-surface-border);
  margin-bottom: 0;
  font-size: 0.9em;
}

/* Archive description and notes blockquotes */
.archive-description-block,
.archive-notes-block {
  margin: 0.75rem 0;
  padding: 1rem;
  line-height: 1.5;
  quotes: none;
}

/* Remove Claro's quotation marks */
.archive-description-block::before,
.archive-description-block::after,
.archive-notes-block::before,
.archive-notes-block::after {
  content: none;
}

.archive-description-block {
  background-color: var(--dai-surface-bg);
  border-left: 4px solid var(--dai-accent-info);
}

.archive-notes-block {
  background-color: var(--dai-notes-bg);
  border-left: 4px solid var(--dai-notes-border);
}

/* Disclaimer example blockquote */
.disclaimer-example {
  background-color: var(--dai-surface-bg);
  padding: 1rem;
  border-left: 4px solid var(--dai-accent-info);
  margin: 0.75rem 0;
  line-height: 1.5;
}

/* ===== Archive Edit Form Warning ===== */
/* Warning shown when editing archived content */
.archive-edit-warning {
  margin-bottom: 1.5rem;
}

.archive-edit-warning strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.archive-edit-warning p {
  margin: 0.5rem 0 0 0;
  line-height: 1.5;
}

/* Archive acknowledgment checkbox - prominent styling */
.archive-acknowledgment-checkbox {
  margin-top: 0.5rem;
}

/* Wrapper for the acknowledgment field */
.form-item-archive-acknowledgment {
  background-color: var(--dai-surface-bg);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--dai-surface-radius);
  border-left: 3px solid var(--dai-badge-warning-bg);
}

.form-item-archive-acknowledgment label {
  font-weight: 600;
}

/* ===== Manual Archive Form Intro Box ===== */
.manual-archive-intro-box {
  background-color: var(--dai-surface-bg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: var(--dai-surface-radius);
  border-left: 3px solid var(--dai-accent-info);
}

.manual-archive-intro-box h3 {
  margin-top: 0;
}

.manual-archive-intro-box p:last-child {
  margin-bottom: 0;
}

.manual-archive-intro-box ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.manual-archive-intro-box li {
  margin-bottom: 0.5rem;
}

.manual-archive-intro-box li:last-child {
  margin-bottom: 0;
}

/* Manual Archive Form - Visibility fieldset spacing */
.manual-archive-form fieldset .description {
  margin-top: 0.25rem;
}

/* ===== Settings Form Accessibility ===== */
/* Ensure WCAG 1.4.12 compliance: line-height at least 1.5 for paragraphs */
#digital-asset-inventory-settings .messages p,
#digital-asset-inventory-settings p {
  line-height: 1.5;
}

/* ===== Archive Forms Accessibility ===== */
/* Ensure WCAG 1.4.8 compliance: line-height at least 1.5 for paragraphs and blockquotes */
#digital-asset-inventory-execute-archive-form p,
#digital-asset-inventory-execute-archive-form blockquote,
#digital-asset-inventory-execute-archive-form li,
#digital-asset-inventory-manual-archive-form p,
#digital-asset-inventory-manual-archive-form blockquote,
#digital-asset-inventory-manual-archive-form li,
#digital-asset-inventory-unarchive-form p,
#digital-asset-inventory-unarchive-form blockquote,
#digital-asset-inventory-unarchive-form li,
#digital-asset-inventory-toggle-archive-visibility-form p,
#digital-asset-inventory-toggle-archive-visibility-form blockquote,
#digital-asset-inventory-toggle-archive-visibility-form li,
#digital-asset-inventory-archive-asset-form p,
#digital-asset-inventory-archive-asset-form blockquote,
#digital-asset-inventory-archive-asset-form li,
#digital-asset-inventory-cancel-archive-form p,
#digital-asset-inventory-cancel-archive-form blockquote,
#digital-asset-inventory-cancel-archive-form li,
#digital-asset-inventory-delete-archived-file-form p,
#digital-asset-inventory-delete-archived-file-form blockquote,
#digital-asset-inventory-delete-archived-file-form li,
#digital-asset-inventory-delete-manual-archive-form p,
#digital-asset-inventory-delete-manual-archive-form blockquote,
#digital-asset-inventory-delete-manual-archive-form li,
.confirm-form p,
.confirm-form blockquote,
.confirm-form li {
  line-height: 1.5;
}

/* ===== Asset Usage View Responsive Tables ===== */

/* Usage view desktop styles */
@media (min-width: 1024px) {
  .view-digital-asset-usage table.views-table {
    table-layout: auto;
    width: 100%;
  }

  .view-digital-asset-usage td,
  .view-digital-asset-usage th {
    overflow-wrap: anywhere;
    word-wrap: break-word;
  }
}

/* Usage view Tablesaw stacked mode (Mobile: 640px and below) */
@media (max-width: 640px) {
  .view-digital-asset-usage table.views-table {
    display: block !important;
    width: 100% !important;
  }

  /* Force block display on all table elements */
  .view-digital-asset-usage .tablesaw-stack,
  .view-digital-asset-usage .tablesaw-stack thead,
  .view-digital-asset-usage .tablesaw-stack tbody,
  .view-digital-asset-usage .tablesaw-stack tr,
  .view-digital-asset-usage .tablesaw-stack th {
    display: block !important;
    width: 100% !important;
  }

  .view-digital-asset-usage .tablesaw-stack tbody tr {
    border-bottom: 2px solid var(--dai-surface-border);
    margin-bottom: 1rem;
    padding: 0.5rem 0;
  }

  /* Use flexbox on td to force vertical stacking */
  .view-digital-asset-usage .tablesaw-stack td {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: none !important;
    white-space: normal !important;
    overflow: visible !important;
    box-sizing: border-box;
    padding: 0.5rem 0;
    line-height: 1.4;
  }

  /* Reset Tablesaw's float-based layout */
  .view-digital-asset-usage .tablesaw-stack td .tablesaw-cell-label,
  .view-digital-asset-usage .tablesaw-stack td .tablesaw-cell-content {
    float: none !important;
    width: 100% !important;
    display: block !important;
    position: static !important;
    clear: both !important;
  }

  .view-digital-asset-usage .tablesaw-stack td .tablesaw-cell-label {
    font-weight: 700;
    margin-bottom: 0.25rem;
    order: 1;
  }

  .view-digital-asset-usage .tablesaw-stack td .tablesaw-cell-content {
    word-break: break-word;
    overflow-wrap: anywhere;
    order: 2;
  }
}

/* Usage view CSS stacked mode (Tablet/Zoom: 641px to 1023px) */
/* Card-based layout matching public archive registry */
@media (min-width: 641px) and (max-width: 1023px) {
  .view-digital-asset-usage table.views-table {
    table-layout: auto !important;
    border: 0 !important;
  }

  .view-digital-asset-usage table.views-table thead {
    display: none;
  }

  /* Force block display on tbody */
  .view-digital-asset-usage table.views-table tbody {
    display: block;
  }

  /* Each row becomes a card */
  .view-digital-asset-usage table.views-table tbody tr {
    display: block;
    border: 1px solid var(--dai-surface-border);
    border-radius: var(--dai-surface-radius);
    margin-bottom: 1rem;
    padding: 0;
    background-color: var(--dai-surface-bg-alt);
  }

  /* Each cell becomes a block with separator */
  .view-digital-asset-usage table.views-table td {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    box-sizing: border-box;
    padding: 0.75rem !important;
    border: none !important;
    border-bottom: 1px solid var(--dai-surface-border) !important;
    text-align: left !important;
    line-height: 1.4;
  }

  /* Last cell - no bottom border */
  .view-digital-asset-usage table.views-table td:last-child {
    border-bottom: none !important;
  }

  /* Labels for usage view columns */
  .view-digital-asset-usage table.views-table td.views-field-usage-title::before {
    content: "Used On";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-usage table.views-table td.views-field-usage-entity-type::before {
    content: "Item Type";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-usage table.views-table td.views-field-usage-bundle::before {
    content: "Item Category";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-usage table.views-table td.views-field-usage-field::before {
    content: "Section";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-usage table.views-table td.views-field-usage-required::before {
    content: "Required Field";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
  .view-digital-asset-usage table.views-table td.views-field-count::before {
    content: "Times Used";
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }

  .view-digital-asset-usage table.views-table td.views-field-usage-title {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

/* ===== Asset Usage Info Header ===== */
/* Header displayed on asset usage detail page */
.asset-info-header {
  margin-bottom: 1.5em;
}

.asset-info-header__wrapper {
  background-color: var(--dai-surface-bg);
  padding: 1rem 1.25rem;
  border-radius: var(--dai-surface-radius);
  border-left: 3px solid var(--dai-accent-info);
}

/* Note: .asset-info-header__content nested container removed for surface-first pattern */

.asset-info-header__title {
  margin-bottom: 0.4em;
}

.asset-info-header__name {
  font-size: 1.1em;
  font-weight: 700;
}

.asset-info-header__filename {
  color: var(--dai-text-muted);
  font-size: 0.9em;
}

.asset-info-header__meta {
  color: var(--dai-text-muted);
  font-size: 0.9em;
}

.asset-info-header__divider {
  color: var(--dai-text-muted);
  padding: 0 0.25em;
}

.asset-info-header__url {
  margin-top: 0.4em;
  font-size: 0.85em;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.asset-info-header__url a {
  text-decoration: underline;
}

.asset-info-header__url a:hover,
.asset-info-header__url a:focus {
  text-decoration-thickness: 2px;
}

.asset-info-header__back {
  margin: 0.75em 0 0 0;
}

.asset-info-header__back a {
  text-decoration: underline;
}

.asset-info-header__back a:hover,
.asset-info-header__back a:focus {
  text-decoration-thickness: 2px;
}

/* ===== Intentional Action Button ===== */
/* Button style for actions that are serious but not destructive.
 * Used for "Remove from Public View" and similar intentional actions.
 * Amber/dark gray color signals "think before clicking" without
 * implying data loss (which red would suggest).
 */
.button--intentional {
  background-color: var(--dai-btn-intentional-bg);
  border-color: var(--dai-btn-intentional-bg);
  color: #fff;
}

.button--intentional:hover,
.button--intentional:focus {
  background-color: var(--dai-btn-intentional-hover-bg);
  border-color: var(--dai-btn-intentional-hover-bg);
  color: #fff;
}

.button--intentional:active {
  background-color: var(--dai-btn-intentional-active-bg);
  border-color: var(--dai-btn-intentional-active-bg);
}

/* Secondary button - quieter visual weight */
.button--secondary {
  background-color: var(--dai-btn-secondary-bg);
  border: 1px solid var(--dai-btn-secondary-border);
  color: var(--dai-btn-secondary-text);
}

.button--secondary:hover,
.button--secondary:focus {
  background-color: var(--dai-btn-secondary-hover-bg);
  border-color: var(--dai-btn-secondary-hover-border);
  color: var(--dai-btn-secondary-text);
}

.button--secondary:active {
  background-color: var(--dai-btn-secondary-hover-bg);
  filter: brightness(0.95);
}

/* Danger button - destructive actions */
.button--danger {
  background-color: var(--dai-btn-danger-bg);
  border-color: var(--dai-btn-danger-bg);
  color: #fff;
}

.button--danger:hover,
.button--danger:focus {
  background-color: var(--dai-btn-danger-hover-bg);
  border-color: var(--dai-btn-danger-hover-bg);
  color: #fff;
}

.button--danger:active {
  background-color: var(--dai-btn-danger-active-bg);
  border-color: var(--dai-btn-danger-active-bg);
}

/* ===== Notes Page ===== */
/* Styles for the internal notes page (/admin/digital-asset-inventory/archive/{id}/notes) */

.dai-notes-page__back {
  margin-bottom: 1.5rem;
}

.dai-notes-page__back a {
  color: var(--dai-accent-info);
  text-decoration: underline;
}

.dai-notes-page__back a:hover,
.dai-notes-page__back a:focus {
  text-decoration-thickness: 2px;
}

/* Helper text explaining the page purpose */
.dai-notes-page__helper-text {
  color: var(--dai-text-muted);
  font-size: 0.95em;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.dai-notes-page__section {
  margin-bottom: 2rem;
}

.dai-notes-page__section-title {
  font-size: 1.1rem;
  margin: 0 0 0.5rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--dai-surface-border);
}

/* Initial note section - context area with more breathing room */
.dai-notes-page__section--initial {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--dai-surface-border);
}

.dai-notes-page__initial-note {
  background-color: var(--dai-surface-bg);
  padding: 1rem 1.25rem;
  border-left: 2px solid var(--dai-surface-border);
  line-height: 1.5;
  font-weight: 400;
  max-width: 48rem;
}

.dai-notes-page__empty {
  color: var(--dai-text-muted);
  font-style: italic;
}

.dai-notes-page__add-form {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--dai-surface-bg);
  border-radius: var(--dai-surface-radius);
}

.dai-notes-page__add-form textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
}

/* Notes list - activity record with tighter spacing */
.dai-notes-page__notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dai-notes-page__note {
  background-color: var(--dai-surface-bg);
  padding: 0.875rem 1rem;
  border-left: 3px solid var(--dai-accent-info);
}

.dai-notes-page__note-content {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.dai-notes-page__note-text {
  line-height: 1.5;
  font-weight: 500;
}

/* Note metadata - lighter and smaller */
.dai-notes-page__note-meta {
  font-size: 0.8rem;
  color: var(--dai-text-muted);
  font-weight: 400;
}

.dai-notes-page__note-author {
  font-weight: 500;
}

.dai-notes-page__note-separator {
  margin: 0 0.25rem;
  opacity: 0.6;
}

/* Notes link in views */
.dai-notes-link {
  white-space: nowrap;
}
