* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 20px;
    background: white;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: -20px;
    margin-bottom: 30px;
    font-size: 14px;
    color: #666;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #2c3e50;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-separator {
    color: #999;
    user-select: none;
}

h1 {
    color: #2c3e50;
    margin: 0;
    flex-shrink: 0;
}

h1#mainTitle {
    transition: color 0.2s;
}

h1#mainTitle:hover {
    color: #3498db;
}

.search-bar {
    display: flex;
    gap: 10px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

#searchInput {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#statusFilter {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-icon {
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    min-width: 40px;
    height: 40px;
}

.btn-nav {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #3498db;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s;
    min-width: 60px;
    height: auto;
}

.btn-nav:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-nav .material-icons {
    font-size: 20px;
}

.btn-nav .btn-nav-label {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-icon[style*="background: #3498db"]:hover,
.btn-icon:not([style*="background"]):hover {
    background: #2980b9;
}

.btn-icon[style*="background: #95a5a6"]:hover {
    background: #7f8c8d;
}

.btn-icon .material-icons {
    font-size: 20px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-info {
    background: #3498db;
    color: white;
}

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

.loading, .error {
    padding: 20px;
    text-align: center;
    background: white;
    border-radius: 8px;
    margin-bottom: 20px;
}

.error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.dashboard-card {
    background: white;
    border-radius: 6px;
    padding: 8px 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.2s;
}

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

.dashboard-card-active {
    border-top: 2px solid #2e7d32;
}

.dashboard-card-inactive {
    border-top: 2px solid #757575;
}

.dashboard-card-failed {
    border-top: 2px solid #d32f2f;
}

.dashboard-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 2px;
    font-weight: 500;
}

.dashboard-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.dashboard-card-active .dashboard-value {
    color: #2e7d32;
}

.dashboard-card-inactive .dashboard-value {
    color: #757575;
}

.dashboard-card-failed .dashboard-value {
    color: #d32f2f;
}

@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.service-group {
    width: 100%;
}

.service-group-header {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ddd;
}

.services-list-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

@media (max-width: 1400px) {
    .services-list-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services-list-group {
        grid-template-columns: 1fr;
    }
}

.service-card {
    background: white;
    border-radius: 8px;
    padding: 14px 18px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
}

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

.service-info {
    flex: 1;
}

.service-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    border: 2px solid #4c4c4c;
}

.service-avatar img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
}

.service-avatar span {
    position: relative;
    z-index: 1;
}

#modalServiceAvatar {
    width: 56px;
    height: 56px;
    font-size: 20px;
    position: relative;
    background: white;
    color: #667eea;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    overflow: hidden;
}

#modalServiceAvatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    z-index: 0;
}

#modalServiceAvatar img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    z-index: 0;
}

#modalServiceAvatar span {
    position: relative;
    z-index: 1;
}

.logo-upload-btn {
    position: absolute !important;
    bottom: -4px !important;
    right: -4px !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    background: #3498db !important;
    color: white !important;
    border: 2px solid white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    padding: 0 !important;
    z-index: 10 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.service-name {
    font-size: 26px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
    line-height: 1.3;
}

.service-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 2px;
    line-height: 1.3;
}

.service-subtitle-chip {
    margin-bottom: 2px;
    margin-top: 2px;
}

.service-technical-name {
    font-size: 13px;
    color: #666;
    font-family: 'Courier New', Courier, monospace;
    background-color: #f5f5f5;
    padding: 3px 8px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 4px;
    line-height: 1.3;
}

.service-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

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

.status-active .status-icon-status-active {
    color: #27ae60;
}

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

.status-inactive .status-icon-status-inactive {
    color: #95a5a6;
}

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

.status-failed .status-icon-status-failed {
    color: #e74c3c;
}

/* MUI-style Chip */
.mui-chip {
    display: inline-flex;
    align-items: center;
    height: 24px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0 8px;
    border-radius: 16px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1;
    white-space: nowrap;
    background-color: transparent;
    border: 1px solid;
}

.mui-chip-icon {
    font-size: 16px;
    margin-right: 4px;
    margin-left: 0;
    display: inline-flex;
    align-items: center;
}

.mui-chip-label {
    display: inline-flex;
    align-items: center;
}

/* Outlined variant colors */
.mui-chip-primary {
    border-color: #1976d2;
    color: #1976d2;
}

.mui-chip-primary .mui-chip-icon {
    color: #1976d2;
}

.mui-chip-primary-filled {
    background-color: #1976d2;
    color: white;
    border-color: #1976d2;
}

.mui-chip-primary-filled .mui-chip-icon {
    color: white;
}

.mui-chip-primary-filled .material-icons {
    color: white;
}

.mui-chip-success {
    border-color: #2e7d32;
    color: #2e7d32;
}

.mui-chip-success .mui-chip-icon {
    color: #2e7d32;
}

.mui-chip-error {
    border-color: #d32f2f;
    color: #d32f2f;
}

.mui-chip-error .mui-chip-icon {
    color: #d32f2f;
}

.mui-chip-default {
    border-color: #757575;
    color: #757575;
}

.mui-chip-default .mui-chip-icon {
    color: #757575;
}

/* Larger chip for modal header */
#modalServiceStatus .mui-chip {
    height: 32px;
    font-size: 0.875rem;
    padding: 0 12px;
}

#modalServiceStatus .mui-chip-icon {
    font-size: 18px;
    margin-right: 6px;
}

.service-description {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-actions-inline {
    display: flex;
    gap: 5px;
}

.service-actions-inline .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Modal */
body.modal-open {
    overflow: hidden;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.modal-content.modal-maximized {
    width: 98%;
    max-width: 98%;
    height: 98vh;
    max-height: 98vh;
    margin: 1vh auto;
    border-radius: 4px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.service-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.config-section > span {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.config-content {
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    background: #f8f9fa;
    color: #333;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #e0e0e0;
    padding: 8px;
    margin: 0;
    box-sizing: border-box;
}

.logs-section {
    margin-top: 20px;
}

.logs-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.logs-controls input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.logs-controls input[type="number"] {
    width: 100px;
}

.logs-controls input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.logs-container {
    background: #1e1e1e;
    border-radius: 4px;
    padding: 15px;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: auto;
}

#logsContent {
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    background: #27ae60;
}

.notification.error {
    background: #e74c3c;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Confirmation Dialog Styles */
#confirmServiceNameInput:focus {
    outline: none;
    border-color: #e74c3c;
}

#confirmServiceNameInput:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    header {
        flex-direction: column;
        align-items: stretch;
    }
    
    header h1 {
        width: 100%;
    }
    
    header .search-bar {
        width: 100%;
        margin: 0 !important;
        order: 2;
    }
    
    header > div:last-child {
        width: 100%;
        order: 3;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: stretch;
    }
    
    header h1 {
        width: 100%;
        text-align: center;
    }
    
    header .search-bar {
        width: 100%;
        margin: 0 !important;
        flex-direction: column;
        order: 2;
    }
    
    header .search-bar #searchInput {
        width: 100%;
    }
    
    header .search-bar #statusFilter {
        width: 100%;
    }
    
    header > div:last-child {
        width: 100%;
        order: 3;
        flex-direction: column;
        gap: 10px;
    }
    
    header > div:last-child .btn {
        width: 100%;
    }
}

/* Pulse animation for skeleton loading */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Disk Stats Styles */
.disk-stats-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.disk-stat-item {
    margin-bottom: 20px;
}

.disk-stat-item:last-child {
    margin-bottom: 0;
}

.disk-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.disk-stat-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.disk-stat-info {
    font-size: 12px;
    color: #666;
}

.disk-progress-bar {
    position: relative;
    height: 32px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.disk-progress-text {
    position: absolute;
    right: 8px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    pointer-events: none;
}

.disk-progress-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    transition: width 0.3s ease;
}

.disk-progress-segment.used {
    color: white;
}

.disk-progress-segment.used.type-root.status-green {
    background: #27ae60;
}

.disk-progress-segment.used.type-root.status-warning {
    background: #f39c12;
}

.disk-progress-segment.used.type-root.status-danger {
    background: #e74c3c;
}

.disk-progress-segment.used.type-boot.status-green {
    background: #3498db;
}

.disk-progress-segment.used.type-boot.status-warning {
    background: #f39c12;
}

.disk-progress-segment.used.type-boot.status-danger {
    background: #e74c3c;
}

.disk-progress-segment.used.type-other.status-green {
    background: #9b59b6;
}

.disk-progress-segment.used.type-other.status-warning {
    background: #f39c12;
}

.disk-progress-segment.used.type-other.status-danger {
    background: #e74c3c;
}

.disk-progress-segment.free {
    background: #ecf0f1;
    color: #7f8c8d;
    justify-content: flex-end;
    padding-right: 8px;
}

.disk-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.disk-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.disk-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.disk-legend-color.used-root {
    background: #27ae60;
}

.disk-legend-color.used-boot {
    background: #3498db;
}

.disk-legend-color.used-other {
    background: #9b59b6;
}

.disk-legend-color.free {
    background: #ecf0f1;
    border: 1px solid #bdc3c7;
}

.disk-legend-color.warning {
    background: #f39c12;
}

.disk-legend-color.danger {
    background: #e74c3c;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f5f5f5;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 30px;
    text-align: center;
    color: #2c3e50;
}

.login-form-group {
    margin-bottom: 20px;
}

.login-form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.login-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.login-form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.login-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    display: none;
}

.login-error.show {
    display: block;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover {
    background: #2980b9;
}

.login-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

