/**
 * Director Portal Styles
 */

/* Portal Layout */
.director-portal-page {
    padding: 2rem 0;
}

.director-portal-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Portal Header */
.portal-header {
    background: linear-gradient(135deg, #1A7A8A 0%, #2A9AAF 100%);
    color: white;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.portal-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.portal-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: white !important;
    font-family: 'Playfair Display', Georgia, serif;
}

.portal-facility-info {
    font-size: 1.1rem;
    color: white !important;
}

.facility-code {
    opacity: 0.9;
    margin-left: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Tab Navigation */
.portal-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.portal-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 6px;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.portal-tab:hover {
    background: #f5f5f5;
    border-color: #2A9AAF;
}

.portal-tab.active {
    background: #1A7A8A;
    color: white;
    border-color: #1A7A8A;
}

/* Tab Content */
.portal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.portal-tab-panel {
    display: none;
}

.portal-tab-panel.active {
    display: block;
}

/* Sections */
.overview-section,
.details-section,
.inventory-section,
.roster-section,
.settings-section,
.progress-section,
.certificates-section {
    margin-bottom: 3rem;
}

.overview-section:last-child,
.details-section:last-child,
.inventory-section:last-child,
.roster-section:last-child,
.settings-section:last-child,
.progress-section:last-child,
.certificates-section:last-child {
    margin-bottom: 0;
}

.overview-section h2,
.details-section h2,
.inventory-section h2,
.roster-section h2,
.settings-section h2,
.progress-section h2,
.certificates-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #135E6B;
    font-family: 'Playfair Display', Georgia, serif;
}

/* Progress Bar */
.progress-bar-wrapper {
    margin: 2rem 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1A7A8A 0%, #2A9AAF 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 1rem;
    color: white;
    font-weight: 600;
}

.progress-percentage {
    display: block;
    text-align: right;
    margin-top: 0.5rem;
    font-weight: 600;
    color: #1A7A8A;
}

/* Checklist */
.checklist {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 1.5rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #e0e0e0;
    transition: all 0.3s ease;
}

.checklist-item.completed {
    border-left-color: #2A9AAF;
}

.checklist-item.pending {
    border-left-color: #f39c12;
}

.checklist-item.future {
    opacity: 0.5;
}

.checklist-icon {
    font-size: 1.5rem;
}

.checklist-label {
    flex: 1;
    font-weight: 600;
}

.checklist-date {
    color: #666;
    font-size: 0.9rem;
}

.checklist-action {
    color: #1A7A8A;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background: #f0f8f9;
    transition: all 0.3s ease;
}

.checklist-action:hover {
    background: #1A7A8A;
    color: white;
}

.checklist-note {
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
}

/* Summary Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.summary-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.summary-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.summary-card:hover {
    border-color: #2A9AAF;
    box-shadow: 0 4px 12px rgba(26, 122, 138, 0.15);
    transform: translateY(-2px);
}

.summary-card.primary {
    background: linear-gradient(135deg, #1A7A8A 0%, #2A9AAF 100%);
    color: white;
    border: none;
}

.summary-card.warning {
    background: #fff3cd;
    border-color: #f39c12;
}

.summary-label {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.summary-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Playfair Display', Georgia, serif;
}

.summary-note {
    color: #666;
    font-style: italic;
    margin-top: 1rem;
}

/* Quick Actions */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.action-button:hover {
    border-color: #1A7A8A;
    background: #f0f8f9;
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(26, 122, 138, 0.15);
}

.action-icon {
    font-size: 2.5rem;
}

.action-label {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Forms */
.portal-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1A7A8A;
}

.help-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.required {
    color: #e74c3c;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #1A7A8A;
    color: white;
}

.btn-primary:hover {
    background: #2A9AAF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 122, 138, 0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tables */
.portal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.portal-table thead {
    background: #f5f5f5;
}

.portal-table th,
.portal-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.portal-table th {
    font-weight: 600;
    color: #135E6B;
}

.portal-table tbody tr:hover {
    background: #f9f9f9;
}

.order-history-row {
    cursor: pointer;
}

.order-history-row:focus-visible {
    outline: 3px solid #f4c542;
    outline-offset: -3px;
}

.order-history-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid #9bc8d1;
    border-radius: 999px;
    background: #ecf6f8;
    color: #0f5563;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.order-history-toggle:hover {
    background: #dff0f4;
    border-color: #6eaebb;
    transform: translateY(-1px);
}

.order-history-toggle[aria-expanded="true"] {
    background: #16596a;
    border-color: #16596a;
    color: #fff;
}

.order-history-number {
    line-height: 1;
}

.order-history-cta {
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    opacity: 0.92;
}

.order-history-details-row td {
    background: #f7fbfc;
    border-bottom: 1px solid #d6e8ed;
}

.order-history-details {
    padding: 0.9rem 0.25rem 0.25rem;
}

.order-history-details h3 {
    margin: 0 0 0.75rem;
    font-size: 1.08rem;
    color: #135e6b;
}

.order-history-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.order-history-details-header h3 {
    margin-bottom: 0;
}

.order-history-empty {
    margin: 0;
    color: #47636a;
}

.order-items-table {
    margin: 0.5rem 0 0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-secondary {
    background: #e0e0e0;
    color: #666;
}

.badge-primary {
    background: #d1ecf1;
    color: #0c5460;
}

/* Notices */
.notice {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.notice-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.notice-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.notice-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.notice-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* Loading & Empty States */
.loading-state,
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.response-message {
    margin-top: 1rem;
}

/* Card */
.card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-card {
    background: #f0f8f9;
    border-left: 4px solid #1A7A8A;
    padding: 1.5rem;
    border-radius: 6px;
}

/* Facility Details Styles */
.facility-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.detail-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #1A7A8A;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    display: block;
    font-weight: 700;
    color: #135E6B;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.detail-value {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.6;
}

.detail-value em {
    color: #999;
    font-style: italic;
}

.equipment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.equipment-list li {
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    border-left: 3px solid #2A9AAF;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.equipment-list li:hover {
    background: #e8f4f5;
    border-left-width: 5px;
    transform: translateX(5px);
}

.details-actions {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
    text-align: center;
}

.details-actions .btn {
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
}

.details-actions .help-text {
    margin-top: 1rem;
    color: #666;
    font-size: 0.95rem;
}

.request-changes-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid #e0e0e0;
}

.request-changes-section h2 {
    color: #135E6B;
}

.request-changes-section p {
    color: #666;
    margin-bottom: 2rem;
}

/* Inventory Page Styles */
.inventory-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.inventory-history-column,
.inventory-upload-column {
    min-height: 400px;
}

.inventory-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 100%;
}

.inventory-card h3 {
    font-size: 1.5rem;
    color: #135E6B;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
    font-family: 'Playfair Display', Georgia, serif;
}

/* Inventory List Styles */
.inventory-list {
    max-height: 600px;
    overflow-y: auto;
    margin-top: 1rem;
}

.inventory-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #f9f9f9;
    border-left: 4px solid #2A9AAF;
    border-radius: 6px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.inventory-item:hover {
    background: #f0f8fa;
    border-left-width: 6px;
    box-shadow: 0 2px 8px rgba(26, 122, 138, 0.15);
}

.inventory-item-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: #1A7A8A;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.inventory-item-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.inventory-item-details {
    flex: 1;
}

.inventory-item-filename {
    font-size: 1.1rem;
    font-weight: 700;
    color: #135E6B;
    margin: 0 0 0.5rem 0;
}

.inventory-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.inventory-item-meta span {
    display: flex;
    align-items: center;
}

.inventory-item-notes {
    font-size: 0.9rem;
    color: #555;
    font-style: italic;
    margin: 0.5rem 0 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid #e0e0e0;
}

.inventory-item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.inventory-item-actions .btn {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.inventory-item-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Upload Form Styles */
.inventory-upload-column .portal-form .btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.inventory-upload-column .form-group {
    margin-bottom: 1.5rem;
}

/* Empty and Loading States */
.inventory-card .empty-state,
.inventory-card .loading-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.inventory-card .empty-state p,
.inventory-card .loading-state p {
    font-size: 1.1rem;
    margin: 0;
}

/* Roster-Specific Styles */
.import-methods {
    background: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.import-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.import-tab {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.import-tab:hover {
    border-color: #1A7A8A;
    background: #f0f8f9;
}

.import-tab.active {
    background: #1A7A8A;
    color: white;
    border-color: #1A7A8A;
}

.import-method {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 8px;
}

.import-method.active {
    display: block;
}

.import-method h3 {
    font-size: 1.3rem;
    color: #135E6B;
    margin-bottom: 1rem;
}

.import-method p {
    margin-bottom: 1.5rem;
    color: #666;
}

.format-examples {
    background: #f5f5f5;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.format-examples li {
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
    color: #333;
}

.format-examples code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    color: #1A7A8A;
}

/* Manual Entry Rows */
.manual-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr auto;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: start;
}

.manual-row input {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
}

.manual-row input:focus {
    outline: none;
    border-color: #1A7A8A;
}

.btn-remove-row {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.btn-remove-row:hover:not(:disabled) {
    background: #c0392b;
}

.btn-remove-row:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#add-another-row {
    margin-right: 1rem;
    margin-bottom: 1rem;
}

/* Roster Actions */
.roster-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

#roster-search {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
}

#roster-search:focus {
    outline: none;
    border-color: #1A7A8A;
}

/* Current Roster Section */
.current-roster {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid #e0e0e0;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-info {
    background: #d1ecf1;
    color: #0c5460;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
}

.status-default {
    background: #e0e0e0;
    color: #666;
}

/* Table Actions */
.portal-table .actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.btn-edit-tech,
.btn-delete-tech {
    padding: 0.5rem;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit-tech:hover {
    background: #1A7A8A;
    color: white;
    border-color: #1A7A8A;
}

.btn-delete-tech:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

/* Progress Bars in Table */
.progress-bar {
    position: relative;
    width: 100%;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1A7A8A 0%, #2A9AAF 100%);
    transition: width 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
}

/* Settings Info */
.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.25rem;
    align-items: start;
}

.settings-main .portal-form {
    max-width: 100%;
}

.settings-info {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.settings-main .settings-info {
    margin-top: 1.25rem;
}

.settings-info h3 {
    color: #135E6B;
    margin-bottom: 1rem;
}

.about-deadlines-card h3 {
    margin-top: 0.25rem;
}

.info-card ul {
    margin-left: 1.5rem;
}

.info-card li {
    margin-bottom: 0.5rem;
}

/* Progress Filters */
.progress-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.progress-filters select {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
}

.progress-filters select:focus {
    outline: none;
    border-color: #1A7A8A;
}

/* Certificates Actions */
.certificates-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.certificates-info {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Response Messages */
.response-message {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
}

.response-message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.response-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.response-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* Scheduled progress reporting controls */
.reports-settings-section {
    border-top: 0;
    border-left: 1px solid #dce6ec;
    padding-top: 0;
    padding-left: 2.25rem;
}

.form-group-checkboxes .checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.reports-settings-section .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.reports-settings-section .form-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reports-manual-send,
.reports-recipient-manager {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px dashed #d8e2e8;
}

.reports-manual-send h3,
.reports-recipient-manager h3 {
    margin-bottom: 0.65rem;
    color: #145968;
}

.reports-manual-send .form-inline {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
}

.recipient-table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
}

.recipient-remove-btn {
    color: #8a2330;
    text-decoration: underline;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.recipient-remove-btn:hover {
    color: #b22638;
}

/* Responsive */
@media (max-width: 768px) {
    .portal-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-title {
        font-size: 1.5rem;
    }

    .portal-tabs {
        flex-direction: column;
    }

    .portal-tab {
        width: 100%;
        text-align: left;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    /* Scrollable portal tables — prevent horizontal overflow */
    .portal-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.9rem;
        width: 100%;
    }

    .portal-table th,
    .portal-table td {
        padding: 0.5rem;
        /* Allow cells to wrap text instead of forcing wide rows */
        white-space: normal;
    }

    /* Restore nowrap only for status badges and action cells */
    .portal-table .status-badge,
    .portal-table .actions {
        white-space: nowrap;
    }

    /* Touch targets — action icon buttons */
    .btn-edit-tech,
    .btn-delete-tech {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.5rem;
    }

    /* Touch targets — small buttons */
    .btn-small {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Touch targets — checklist actions */
    .checklist-action {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
        display: inline-flex;
        align-items: center;
    }

    .manual-row {
        grid-template-columns: 1fr;
    }

    .roster-actions,
    .progress-filters,
    .certificates-actions,
    .form-actions {
        flex-direction: column;
    }

    .roster-actions input,
    .progress-filters select {
        width: 100%;
        /* Override the desktop min-width so input fills available space */
        min-width: 0;
    }

    .facility-details-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }

    .detail-item {
        padding: 1rem;
    }

    .details-actions .btn {
        width: 100%;
    }

    .inventory-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .inventory-item {
        flex-direction: column;
    }

    .inventory-item-icon {
        width: 40px;
        height: 40px;
    }

    .inventory-item-icon .dashicons {
        font-size: 24px;
        width: 24px;
        height: 24px;
    }

    .inventory-item-actions {
        flex-direction: row;
        width: 100%;
    }

    .inventory-item-actions .btn {
        flex: 1;
    }

    .inventory-item-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .settings-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .settings-sidebar {
        border-top: 2px solid #e0e0e0;
        padding-top: 1.25rem;
    }
}

/* Polish pass refinements */
.director-portal-page {
    padding: clamp(1.25rem, 2vw, 2.25rem) 0 clamp(2rem, 3vw, 3rem);
}

.portal-header {
    position: relative;
    overflow: hidden;
    padding: clamp(1.5rem, 3vw, 2.75rem);
    border-radius: 16px;
    margin-bottom: 1.25rem;
    box-shadow: 0 14px 36px rgba(21, 92, 107, 0.22);
}

.portal-heading-block {
    max-width: 58ch;
}

.portal-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

.portal-title {
    font-size: clamp(1.65rem, 2.5vw, 2.4rem);
    line-height: 1.15;
}

.portal-subtitle {
    margin: 0.75rem 0 0;
    font-size: clamp(0.97rem, 1.35vw, 1.1rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.95);
}

.portal-facility-info {
    min-width: min(100%, 21rem);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
}

.portal-facility-name {
    display: block;
    line-height: 1.3;
}

.facility-code {
    display: inline-block;
    margin-top: 0.25rem;
    margin-left: 0;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    background: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.96);
}

.portal-admin-warning {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.portal-tabs-wrap {
    position: sticky;
    top: 0.5rem;
    z-index: 5;
    margin-bottom: 0.65rem;
}

.portal-tabs {
    gap: 0.35rem;
    margin: 0;
    padding: 0.45rem;
    border: 1px solid #d6e5ea;
    border-radius: 12px;
    box-shadow: 0 3px 16px rgba(17, 72, 83, 0.1);
}

.portal-tab {
    min-height: 44px;
    padding: 0.65rem 1rem;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.portal-tab:hover {
    background: #ecf6f8;
    border-color: #7fbcc8;
    transform: translateY(-1px);
}

.portal-tab.active {
    background: #16596a;
    border-color: #16596a;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.portal-tab:focus-visible,
.btn:focus-visible,
.checklist-action:focus-visible,
.action-button:focus-visible,
.import-tab:focus-visible,
.btn-remove-row:focus-visible,
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible,
#roster-search:focus-visible {
    outline: 3px solid #f4c542;
    outline-offset: 2px;
}

.portal-active-tab-note {
    margin-bottom: 1.25rem;
    color: #29515f;
    font-size: 0.92rem;
    font-weight: 600;
}

.portal-content {
    border: 1px solid #dce8ed;
    border-radius: 14px;
    padding: clamp(1.15rem, 2vw, 2rem);
    box-shadow: 0 8px 24px rgba(26, 87, 102, 0.08);
}

.checklist {
    border: 1px solid #e1edf2;
    border-radius: 10px;
    background: #f7fbfc;
}

.checklist-item {
    min-height: 56px;
    border-left-width: 5px;
}

.action-button {
    align-items: flex-start;
    text-align: left;
    min-height: 160px;
}

.action-icon {
    line-height: 1;
}

.summary-card {
    border-radius: 10px;
}

.summary-card-link:focus-visible .summary-card {
    outline: 3px solid #f4c542;
    outline-offset: 2px;
}

.overview-tab .summary-cards .summary-grid,
.progress-tab .summary-cards .summary-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}

.overview-tab .summary-cards .summary-card,
.progress-tab .summary-cards .summary-card {
    min-width: 0;
    padding: 1.15rem 0.8rem;
}

.overview-tab .summary-cards .summary-value,
.progress-tab .summary-cards .summary-value {
    font-size: clamp(1.85rem, 2vw, 2.35rem);
}

.portal-table th {
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .overview-tab .summary-cards .summary-grid,
    .progress-tab .summary-cards .summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .overview-tab .summary-cards .summary-grid,
    .progress-tab .summary-cards .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .portal-tabs-wrap {
        position: static;
    }

    .portal-tabs {
        border-radius: 10px;
    }

    .portal-active-tab-note {
        margin-bottom: 1rem;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    /*
     * The 6-column overview/progress summary grid is set with high specificity
     * at 920px. Explicitly override to 2 columns on mobile (higher specificity
     * wins over the general .summary-grid rule above).
     */
    .overview-tab .summary-cards .summary-grid,
    .progress-tab .summary-cards .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reports-settings-section .form-grid,
    .reports-settings-section .form-grid-4 {
        grid-template-columns: 1fr;
    }

    .reports-settings-section {
        border-left: 0;
        padding-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-tab,
    .summary-card,
    .action-button,
    .checklist-action,
    .btn {
        transition: none !important;
    }

    .summary-card:hover,
    .action-button:hover,
    .portal-tab:hover,
    .btn-primary:hover {
        transform: none !important;
    }
}
