/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-card h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
}

.stat-card .label {
    font-size: 0.85rem;
    color: #999;
    margin-top: 0.5rem;
}

.stat-card.memory .value { color: #2196F3; }
.stat-card.storage .value { color: #FF9800; }
.stat-card.process .value { color: #9c27b0; }
.stat-card.uptime .value { color: #4caf50; }

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #4caf50;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 4px;
}

/* Details Section */
.details-section {
    margin-top: 2rem;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.detail-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.detail-card h3 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.detail-value {
    color: #333;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card .value {
        font-size: 2rem;
    }

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

@media (max-width: 480px) {
    .stat-card {
        padding: 1rem;
    }

    .stat-card .value {
        font-size: 1.75rem;
    }

    .detail-card {
        padding: 1rem;
    }
}

/* PM2 Section */
.pm2-section {
    margin-top: 2rem;
}

.pm2-section h2 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.pm2-status {
    min-height: 100px;
}

.pm2-loading,
.pm2-error,
.pm2-empty {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    color: #666;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pm2-error {
    color: #f44336;
}

.pm2-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.pm2-table {
    width: 100%;
    border-collapse: collapse;
}

.pm2-table thead {
    background-color: #f8f9fa;
}

.pm2-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

.pm2-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    font-size: 0.9rem;
}

.pm2-table tbody tr:hover {
    background-color: #f8f9fa;
}

.pm2-table tbody tr:last-child td {
    border-bottom: none;
}

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

.pm2-status-badge.status-online {
    background-color: #4caf50;
    color: white;
}

.pm2-status-badge.status-stopped {
    background-color: #999;
    color: white;
}

.pm2-status-badge.status-errored {
    background-color: #f44336;
    color: white;
}

.pm2-status-badge.status-unknown {
    background-color: #FF9800;
    color: white;
}

@media (max-width: 768px) {
    .pm2-table-container {
        overflow-x: auto;
    }
    
    .pm2-table {
        min-width: 800px;
    }
    
    .pm2-table th,
    .pm2-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

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

.modal {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    position: relative;
}

.storage-modal {
    max-width: 1000px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

/* Storage Modal Specific Styles */
.storage-loading,
.storage-error {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.storage-error {
    color: #f44336;
}

.storage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.storage-path,
.storage-total {
    font-size: 0.9rem;
    color: #333;
}

.storage-nav {
    margin-bottom: 1rem;
}

.btn-back {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #5568d3;
}

.storage-table-container {
    overflow-x: auto;
}

.storage-table {
    width: 100%;
    border-collapse: collapse;
}

.storage-table thead {
    background-color: #f8f9fa;
}

.storage-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

.storage-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    font-size: 0.9rem;
}

.storage-table tbody tr:hover {
    background-color: #f8f9fa;
}

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

.type-badge.type-directory {
    background-color: #e3f2fd;
    color: #1976d2;
}

.type-badge.type-file {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.btn-view,
.btn-delete {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    transition: all 0.3s;
}

.btn-view {
    background: #2196F3;
    color: white;
}

.btn-view:hover {
    background: #1976d2;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #d32f2f;
}

.stat-card.clickable {
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card.clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .storage-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .storage-table {
        min-width: 700px;
    }
    
    .storage-table th,
    .storage-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
}

/* PostgreSQL Section */
.postgres-section {
    margin-top: 2rem;
}

.postgres-section h2 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.postgres-status {
    min-height: 100px;
}

.postgres-loading,
.postgres-error,
.postgres-empty {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    color: #666;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.postgres-error {
    color: #f44336;
}

.postgres-summary {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.postgres-summary-item {
    font-size: 0.9rem;
    color: #333;
}

.postgres-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.postgres-table {
    width: 100%;
    border-collapse: collapse;
}

.postgres-table thead {
    background-color: #f8f9fa;
}

.postgres-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

.postgres-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    font-size: 0.9rem;
}

.postgres-table tbody tr:hover {
    background-color: #f8f9fa;
}

.postgres-percentage-bar {
    position: relative;
    width: 100%;
    height: 24px;
    background-color: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.postgres-percentage-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 12px;
}

.postgres-percentage-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #333;
    z-index: 1;
}

@media (max-width: 768px) {
    .postgres-summary {
        flex-direction: column;
        gap: 1rem;
    }
    
    .postgres-table {
        min-width: 600px;
    }
    
    .postgres-table th,
    .postgres-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
}

