﻿/* ========================================
   MODERN USER ADMINISTRATION STYLES
   ======================================== */

:root {
    --heso-primary: #008679;
    --heso-secondary: #5bc0de;
    --heso-success: #5cb85c;
    --heso-warning: #f0ad4e;
    --heso-danger: #d9534f;
    --heso-info: #5bc0de;
    --heso-dark: #333;
    --heso-light: #f8f9fa;
    --heso-border: #dee2e6;
    --heso-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --heso-radius: 8px;
}

/* Override parent to enable absolute positioning */
.heso-content-area {
    position: relative !important;
}

/* Main Container */
.modern-user-admin {
    padding: 0;
    background: var(--heso-light);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header Section */
.admin-header {
    background: linear-gradient(135deg, #006d77 0%, #006d63 100%);
    padding: 0.75rem 1rem;
    border-radius: var(--heso-radius);
    margin: 2rem 2rem 0.75rem 2rem;
    box-shadow: var(--heso-shadow);
    flex-shrink: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-title .oi {
    font-size: 1.25rem;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.current-user {
    color: white;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
}

.current-user .oi {
    font-size: 0.75rem;
}

/* Header Statistics - Inline Style */
.header-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stat-card {
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.15);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.stat-value-small {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
}

.stat-users {
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stat-context {
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stat-current {
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Toolbar */
.admin-toolbar {
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--heso-radius);
    margin: 0 2rem 0.75rem 2rem;
    box-shadow: var(--heso-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-label {
    font-weight: 500;
    color: var(--heso-dark);
    margin: 0;
    font-size: 0.875rem;
}

.toolbar-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* Buttons */
.heso-btn {
    padding: 0.4rem 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.heso-btn .oi {
    font-size: 0.75rem;
}

.heso-btn-primary {
    background: var(--heso-primary);
    color: white;
}

.heso-btn-primary:hover {
    background: #006d63;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 134, 121, 0.3);
}

.heso-btn-success {
    background: var(--heso-success);
    color: white;
}

.heso-btn-success:hover {
    background: #4cae4c;
    transform: translateY(-1px);
}

.heso-btn-warning {
    background: var(--heso-warning);
    color: white;
}

.heso-btn-warning:hover {
    background: #ec971f;
    transform: translateY(-1px);
}

.heso-btn-info {
    background: var(--heso-info);
    color: white;
}

.heso-btn-info:hover {
    background: #46b8da;
    transform: translateY(-1px);
}

.heso-btn-danger {
    background: var(--heso-danger);
    color: white;
}

.heso-btn-danger:hover {
    background: #c9302c;
    transform: translateY(-1px);
}

.heso-btn-secondary {
    background: #6c757d;
    color: white;
}

.heso-btn-secondary:hover {
    background: #5a6268;
}

.heso-btn-icon {
    padding: 0.35rem;
    background: var(--heso-light);
    border: 1px solid var(--heso-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.heso-btn-icon:hover {
    background: var(--heso-primary);
    color: white;
    border-color: var(--heso-primary);
}

/* Admin-Only Buttons */
.heso-btn-admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.heso-btn-admin:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    filter: brightness(1.1);
}

.heso-btn-admin:active:not(:disabled) {
    transform: translateY(0);
}

.heso-btn-admin:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.heso-btn-admin .oi {
    font-size: 0.875rem;
}

/* Select Input */
.heso-select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--heso-border);
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.heso-select:focus {
    outline: none;
    border-color: var(--heso-primary);
    box-shadow: 0 0 0 3px rgba(0, 134, 121, 0.1);
}

/* Text Input */
.heso-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--heso-border);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.heso-input:focus {
    outline: none;
    border-color: var(--heso-primary);
    box-shadow: 0 0 0 3px rgba(0, 134, 121, 0.1);
}

/* Admin Content Layout */
.admin-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Panel Styles */
.users-panel,
.rights-panel {
    background: white;
    border-radius: var(--heso-radius);
    box-shadow: var(--heso-shadow);
    overflow: hidden;
}

.panel-header {
    background: var(--heso-light);
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--heso-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--heso-dark);
    margin: 0;
}

.user-count {
    font-size: 0.75rem;
    color: #6c757d;
    background: white;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
}

.users-list {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    padding: 0.5rem;
}

/* User Cards - Kompakter */
.user-card {
    background: white;
    border: 1px solid var(--heso-border);
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.user-card:hover {
    border-color: var(--heso-primary);
    box-shadow: 0 2px 6px rgba(0, 134, 121, 0.15);
}

.user-card.selected {
    border-color: var(--heso-primary);
    background: rgba(0, 134, 121, 0.05);
    box-shadow: 0 0 0 2px rgba(0, 134, 121, 0.1);
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    color: var(--heso-dark);
    font-size: 0.875rem;
}

.user-card-header .oi {
    color: var(--heso-primary);
    font-size: 0.875rem;
}

.user-card-details {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--heso-border);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
}

.detail-label {
    color: #6c757d;
    font-weight: 500;
}

.detail-value {
    color: var(--heso-dark);
}

.global-rights {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--heso-border);
}

.global-rights .detail-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
}

/* Rights Panel - Kompakter */
.rights-panel {
    background: white;
    border-radius: var(--heso-radius);
    box-shadow: var(--heso-shadow);
    overflow: hidden;
}

.tree-actions {
    display: flex;
    gap: 0.35rem;
}

.tree-container {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    padding: 0.75rem;
}

/* Modern Tree Node */
.modern-tree-node {
    margin-bottom: 0.5rem;
}

.tree-node-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tree-node-header:hover {
    background: var(--heso-light);
}

.tree-node-header.structural {
    font-weight: 600;
    color: var(--heso-primary);
}

.tree-node-header.with-content {
    background: white;
    border: 1px solid var(--heso-border);
}

.tree-expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--heso-primary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.tree-expand-btn:hover {
    background: var(--heso-light);
    border-radius: 4px;
}

.tree-spacer {
    width: 24px;
}

.node-name {
    flex: 1;
}

.tree-node-children {
    margin-left: 24px;
}

.node-rights-grid {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

/* Modern Rights Editor */
.modern-rights-editor {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--heso-light);
    border-radius: 6px;
    border: 1px solid var(--heso-border);
}

.rights-levels {
  display: flex;
    gap: 0.35rem;
}

.right-btn {
    width: 32px;
  height: 32px;
    border: 2px solid var(--heso-border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.right-btn:hover {
    border-color: var(--heso-primary);
    color: var(--heso-primary);
    transform: scale(1.05);
}

.right-btn.active {
 background: var(--heso-primary);
  border-color: var(--heso-primary);
    color: white;
    box-shadow: 0 2px 6px rgba(0, 109, 119, 0.25);
}

.admin-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--heso-border);
}

.toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
  color: var(--heso-dark);
}

/* Toggle Switch - Kleiner */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
 height: 22px;
    margin: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
position: absolute;
    cursor: pointer;
    top: 0;
  left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
  width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--heso-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

/* Modern Modal */
.modern-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modern-modal.show {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10001;
}

.modal-container {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    z-index: 10002;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--heso-border);
    background: var(--heso-light);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heso-dark);
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--heso-dark);
    transition: all 0.3s ease;
    border-radius: 6px;
}

.modal-close-btn:hover {
    background: var(--heso-danger);
    color: white;
}

.modal-body {
    padding: 2rem 1.5rem;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 2px solid var(--heso-border);
    background: var(--heso-light);
}

/* Form Group */
.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    color: var(--heso-dark);
    font-size: 0.8125rem;
}

/* Alert Warning */
.alert-warning {
    background: #fff3cd;
    border-left: 4px solid var(--heso-warning);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #856404;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    background: white;
    border-radius: var(--heso-radius);
    box-shadow: var(--heso-shadow);
}

.empty-state .oi {
    font-size: 2.5rem;
    color: var(--heso-secondary);
    margin-bottom: 0.75rem;
}

.empty-state h3 {
    color: var(--heso-dark);
    margin-bottom: 0.35rem;
    font-size: 1.125rem;
}

.empty-state p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Loading State */
.loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: white;
    border-radius: var(--heso-radius);
    box-shadow: var(--heso-shadow);
}

/* Error State */
.error-state {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: var(--heso-radius);
    box-shadow: var(--heso-shadow);
    border-left: 4px solid var(--heso-danger);
}

.error-state .oi {
    font-size: 2.5rem;
    color: var(--heso-danger);
    margin-bottom: 0.75rem;
}

.error-state h3 {
    color: var(--heso-danger);
    margin-bottom: 0.35rem;
    font-size: 1.125rem;
}

.error-state p {
    color: var(--heso-dark);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Table Container */
.table-container {
    background: white;
    border-radius: var(--heso-radius);
    box-shadow: var(--heso-shadow);
    overflow: auto;
  flex: 1;
  min-height: 0;
    margin: 0 2rem 2rem 2rem;
    position: relative;
}

/* Permissions Table */
.permissions-table {
  width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.permissions-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
  background: var(--heso-light);
}

.permissions-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
font-weight: 600;
    border-bottom: 2px solid var(--heso-border);
  background: var(--heso-light);
    white-space: nowrap;
}

.tree-header {
    position: sticky;
    left: 0;
    z-index: 12;
    min-width: 250px;
    background: var(--heso-light) !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.tree-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-label {
    font-weight: 600;
    color: var(--heso-dark);
}

.user-header {
    min-width: 200px;
    text-align: center;
    color: var(--heso-primary);
}

.user-header .oi {
    margin-right: 0.35rem;
}

.user-badge-self {
    font-size: 0.75rem;
    color: var(--heso-info);
    font-weight: normal;
    margin-left: 0.25rem;
}

.permissions-table tbody tr {
    transition: background-color 0.2s;
}

.permissions-table tbody tr:hover {
    background: rgba(0, 134, 121, 0.02);
}

.permissions-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--heso-border);
}

.tree-cell {
    position: sticky;
    left: 0;
    background: white !important;
    z-index: 2;
    font-weight: 500;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.permissions-table tbody tr:hover .tree-cell {
    background: #fafffe !important;
}

.rights-cell {
    text-align: center;
    vertical-align: middle;
}

.global-rights-row {
    background: rgba(0, 134, 121, 0.05);
    border-bottom: 2px solid var(--heso-primary) !important;
}

.global-rights-row td {
    padding: 0.75rem;
    font-weight: 600;
}

.global-rights-row .tree-cell {
    background: #f0f9f8 !important;
}

/* Responsive Design */
@media (max-width: 992px) {
    .admin-content {
        grid-template-columns: 1fr;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-actions {
        justify-content: space-between;
    }

    .heso-btn span:not(.oi) {
        display: none;
    }
}

/* Tree Node Styles */
.tree-node-label,
.tree-leaf-label {
    display: flex;
 align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.tree-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
  color: var(--heso-primary);
    transition: all 0.2s;
    border-radius: 4px;
    order: -1;
}

.tree-toggle-btn:hover {
    background: var(--heso-light);
}

.tree-toggle-btn .oi {
    font-size: 0.75rem;
}

.tree-spacer {
    width: 28px;
    display: inline-block;
    order: -1;
}

.tree-folder-name {
    color: var(--heso-primary);
    font-weight: 600;
    display: flex;
  align-items: center;
    gap: 0.35rem;
}

.tree-folder-name .oi {
    order: 1;
}

.tree-leaf-label {
    color: var(--heso-dark);
    display: flex;
    align-items: center;
  gap: 0.35rem;
}

.tree-leaf-label .oi {
    color: #6c757d;
    font-size: 0.75rem;
  order: 1;
}

/* System-Protected Login Styles */
.admin-locked {
display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: #e9ecef;
  color: #6c757d;
    border-radius: 6px;
  font-size: 0.8125rem;
}

.admin-locked .oi {
  font-size: 0.75rem;
}

.admin-locked.system-protected {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #f59e0b;
}

.admin-locked.system-protected .oi {
    color: #d97706;
}

/* ========================================
   HEALTH STATUS PAGE STYLES
   ======================================== */

/* Health Status Container */
.health-status-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Overview Card */
.health-overview-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    border-radius: var(--heso-radius);
    box-shadow: var(--heso-shadow);
    transition: all 0.3s ease;
}

.health-overview-card.status-healthy {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 4px solid var(--heso-success);
}

.health-overview-card.status-degraded {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid var(--heso-warning);
}

.health-overview-card.status-unhealthy {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 4px solid var(--heso-danger);
}

.overview-icon {
    font-size: 3rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.status-healthy .overview-icon {
    color: var(--heso-success);
}

.status-degraded .overview-icon {
    color: var(--heso-warning);
}

.status-unhealthy .overview-icon {
    color: var(--heso-danger);
}

.overview-content {
    flex: 1;
}

.overview-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--heso-dark);
}

.overview-subtitle {
    font-size: 0.95rem;
    margin: 0;
    color: #4b5563;
}

/* Health Checks Grid */
.health-checks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

/* Health Check Card */
.health-check-card {
    background: white;
    border-radius: var(--heso-radius);
    box-shadow: var(--heso-shadow);
    overflow: hidden;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.health-check-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.health-check-card.status-healthy {
    border-left-color: var(--heso-success);
}

.health-check-card.status-degraded {
    border-left-color: var(--heso-warning);
}

.health-check-card.status-unhealthy {
    border-left-color: var(--heso-danger);
}

.check-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--heso-light);
    border-bottom: 1px solid var(--heso-border);
}

.check-status-icon {
    font-size: 1.25rem;
}

.status-healthy .check-status-icon {
    color: var(--heso-success);
}

.status-degraded .check-status-icon {
    color: var(--heso-warning);
}

.status-unhealthy .check-status-icon {
    color: var(--heso-danger);
}

.check-name {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--heso-dark);
}

.check-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.check-status-badge.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.check-status-badge.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.check-status-badge.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.check-body {
    padding: 1rem;
}

.check-description {
    margin: 0 0 0.75rem 0;
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.5;
}

.check-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.check-duration {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.check-tags {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.check-tag {
    padding: 0.15rem 0.5rem;
    background: #e5e7eb;
    color: #374151;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.check-exception {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #fee2e2;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #991b1b;
    font-size: 0.8125rem;
}

.check-exception .oi {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.check-data {
    margin-top: 0.75rem;
    border-top: 1px solid var(--heso-border);
    padding-top: 0.75rem;
}

.heso-btn-link {
    background: none;
    border: none;
    color: var(--heso-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    padding: 0;
    transition: color 0.2s;
}

.heso-btn-link:hover {
    color: #006d63;
    text-decoration: underline;
}

.check-data-table {
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    border-collapse: collapse;
}

.check-data-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--heso-border);
}

.check-data-table .data-key {
    font-weight: 600;
    color: #374151;
    width: 40%;
}

.check-data-table .data-value {
    color: #6b7280;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Summary Section */
.health-summary-section {
    background: white;
    border-radius: var(--heso-radius);
    box-shadow: var(--heso-shadow);
    padding: 1.25rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--heso-dark);
    margin: 0 0 1rem 0;
}

.section-title .oi {
    color: var(--heso-primary);
}

.tag-summary-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tag-summary-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--heso-light);
    border-radius: 6px;
    border: 1px solid var(--heso-border);
}

.tag-name {
    font-weight: 600;
    color: var(--heso-dark);
    font-size: 0.875rem;
}

.tag-stats {
    display: flex;
    gap: 0.35rem;
}

.tag-stat {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tag-stat-healthy {
    background: #d1fae5;
    color: #065f46;
}

.tag-stat-degraded {
    background: #fef3c7;
    color: #92400e;
}

.tag-stat-unhealthy {
    background: #fee2e2;
    color: #991b1b;
}

/* Health Footer */
.health-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.8125rem;
}

.footer-info .oi {
    color: var(--heso-info);
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--heso-primary);
    font-size: 0.8125rem;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #006d63;
    text-decoration: underline;
}

/* Loading State Inline */
.loading-state-inline {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

/* Text utilities */
.text-muted {
    color: #6b7280;
}

/* Responsive Health Grid */
@media (max-width: 768px) {
    .health-checks-grid {
        grid-template-columns: 1fr;
    }
    
    .health-overview-card {
        flex-direction: column;
        text-align: center;
    }
    
    .health-footer {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ========================================
   CERTIFICATE MANAGEMENT STYLES
   ======================================== */

.certificates-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ca-info-card {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
    border-radius: var(--heso-radius);
    overflow: hidden;
}

.ca-info-header {
    background: rgba(40, 167, 69, 0.2);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(40, 167, 69, 0.3);
}

.ca-info-header .oi {
    font-size: 1.25rem;
    color: #28a745;
}

.ca-info-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #155724;
}

.ca-info-body {
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.ca-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 150px;
}

.ca-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #155724;
    opacity: 0.8;
}

.ca-stat-value {
    font-size: 0.875rem;
    color: #155724;
}

.ca-stats-grid {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.ca-mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 6px;
    min-width: 60px;
}

.ca-mini-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
}

.ca-mini-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #666;
}

.ca-mini-active .ca-mini-value {
    color: #28a745;
}

.ca-mini-revoked .ca-mini-value {
    color: #dc3545;
}

/* Certificates Table */
.certificates-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--heso-radius);
    overflow: hidden;
    box-shadow: var(--heso-shadow);
}

.certificates-table thead {
    background: #f8f9fa;
}

.certificates-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.certificates-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.certificates-table tr:hover {
    background: #f8f9fa;
}

.certificates-table tr.revoked {
    opacity: 0.6;
    background: #f5f5f5;
}

.certificates-table tr.expired {
    background: #fff3cd;
}

.serial-preview {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

/* Full serial number display */
.serial-number {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    word-break: break-all;
    display: inline-block;
    max-width: 180px;
    color: #c9302c;
}

.empty-state-inline {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: var(--heso-radius);
    box-shadow: var(--heso-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.empty-state-inline .oi {
    font-size: 2rem;
    color: var(--heso-secondary);
}

.empty-state-inline p {
    margin: 0;
    color: #666;
}

/* Certificate Download Box */
.cert-download-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 1rem 0;
}

.cert-icon {
    font-size: 2rem;
    color: #28a745;
}

.cert-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cert-info strong {
    color: #333;
}

/* nginx Config Box */
.nginx-config-box {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.nginx-config-box pre {
    margin: 0;
    color: #f8f8f2;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.nginx-config-box code {
    color: #f8f8f2;
}

/* Text Warning */
.text-warning {
    color: #856404 !important;
}

/* Empty State Actions */
.empty-state-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* File Selected Indicator */
.file-selected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #d4edda;
    border-radius: 4px;
    color: #155724;
    font-size: 0.875rem;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Alert Info */
.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-left: 4px solid #17a2b8;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

/* Alert Success */
.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

/* Alert Danger */
.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}
