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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    color: #333;
    background: #f5f5f5;
}

/* HEADER */
.header {
    background: #2c3e50;
    color: #fff;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 56px;
    max-width: 1400px;
    margin: 0 auto;
}
.header-logo {
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
}
.header-nav { display: flex; gap: 1rem; }
.nav-link {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9rem;
}
.nav-link:hover { text-decoration: underline; }

/* MAIN */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

/* TOOLBAR */
.toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.toolbar h2 { font-size: 1.3rem; color: #2c3e50; }

/* SEARCH */
.search-form {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 700px;
}
.search-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}
.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: #3498db; color: #fff; }
.btn-primary:hover { background: #2980b9; }
.btn-cancel { background: #95a5a6; color: #fff; }
.btn-cancel:hover { background: #7f8c8d; }
.btn-page {
    background: #fff;
    color: #3498db;
    border: 1px solid #ddd;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}
.btn-page:hover { background: #f0f0f0; }

/* TABLE INFO */
.table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: #666;
}

/* TABLE */
.table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.data-table th {
    background: #34495e;
    color: #fff;
    padding: 0.65rem 0.8rem;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}
.data-table th.sortable:hover { background: #3d566e; }
.sort-indicator { margin-left: 4px; font-size: 0.7rem; }
.data-table td {
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.data-table tbody tr:hover { background: #f8f9fa; }
.clickable-row { cursor: pointer; }
.row-num {
    color: #999;
    font-size: 0.8rem;
    width: 40px;
    min-width: 40px;
}
.actions-col {
    width: 50px;
    min-width: 50px;
    text-align: center;
}
.action-link {
    color: #3498db;
    text-decoration: none;
    font-size: 1rem;
}
.action-link:hover { color: #2980b9; }

/* PAGINATION */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
    flex-wrap: wrap;
}
.page-info { display: flex; gap: 0.3rem; align-items: center; }
.page-link {
    padding: 0.3rem 0.6rem;
    color: #3498db;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
}
.page-link:hover { background: #f0f0f0; }
.page-current {
    padding: 0.3rem 0.6rem;
    background: #3498db;
    color: #fff;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* SIDE PANEL */
.side-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    height: 100vh;
    z-index: 1000;
    transition: right 0.3s ease;
    background: rgba(0,0,0,0.3);
}
.side-panel.open { right: 0; }
.side-panel-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 480px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 12px rgba(0,0,0,0.15);
    overflow-y: auto;
}
.side-panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.side-panel-close:hover { color: #333; }

.panel-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 2px solid #3498db;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-header h3 { font-size: 1.1rem; color: #2c3e50; }
.panel-actions { display: flex; gap: 0.5rem; }
.panel-body { padding: 1rem 1.5rem; }

/* INFO GRID */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.info-label {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.info-value { font-size: 0.9rem; color: #333; }
.section-title {
    font-size: 0.9rem;
    color: #2c3e50;
    margin: 1rem 0 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}

/* ATTRS */
.attrs-list { display: flex; flex-direction: column; gap: 0.3rem; }
.attr-item {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0.5rem;
    background: #e8f4f8;
    border-radius: 4px;
    font-size: 0.8rem;
}
.attr-label { color: #555; font-weight: 600; }
.attr-value { color: #333; text-align: right; word-break: break-all; }
.attrs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

/* DETAIL PAGE */
.detail-page { max-width: 1000px; }
.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: #3498db;
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}
.card-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.card-header h2 { font-size: 1.3rem; color: #2c3e50; }
.card-body { padding: 1.5rem; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    background: #3498db;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.detail-section {
    break-inside: avoid;
}
.detail-section.full-width { grid-column: 1 / -1; }
.detail-section h3 {
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 0.6rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #eee;
}

.detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.3rem 1rem;
    font-size: 0.85rem;
}
.detail-list dt {
    color: #999;
    font-weight: 600;
}
.detail-list dd { color: #333; }

.detail-sections { display: flex; flex-direction: column; gap: 2rem; margin-top: 1rem; }

.komentar {
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 1rem;
    color: #555;
}

.note-text {
    white-space: pre-wrap;
    color: #555;
    font-size: 0.85rem;
}

.link-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.link-list a {
    color: #3498db;
    text-decoration: none;
}
.link-list a:hover { text-decoration: underline; }

.text-muted { color: #999; font-size: 0.85rem; }

/* STATUS DOT */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.status-dot.online {
    background: #2ecc71;
    box-shadow: 0 0 4px rgba(46,204,113,0.5);
}
.status-dot.offline {
    background: #e74c3c;
    box-shadow: 0 0 4px rgba(231,76,60,0.5);
}

/* ALERTS */
.alerts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.alerts-header h2 { font-size: 1.3rem; color: #2c3e50; }
.alerts-stats { display: flex; gap: 1rem; }
.stat {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
}
.stat.critical { background: #f8d7da; color: #e74c3c; }
.stat.warning { background: #fff3cd; color: #f39c12; }

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.alert-group.expanded { grid-column: 1 / -1; }
.tile {
    display: flex;
    gap: 0.75rem;
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 5px solid #ddd;
    transition: box-shadow 0.2s;
    cursor: pointer;
}
.tile:hover { box-shadow: 0 3px 8px rgba(0,0,0,0.12); }
.tile.tile-critical { border-left-color: #e74c3c; }
.tile.tile-warning { border-left-color: #f39c12; }
.tile.tile-ok { border-left-color: #27ae60; }
.tile-icon { font-size: 1.5rem; line-height: 1; }
.tile-body { flex: 1; min-width: 0; }
.tile-label {
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tile-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0.15rem 0;
}
.tile-desc {
    font-size: 0.85rem;
    color: #666;
}
.tile-count {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 0.3rem;
}
.tile-critical .tile-count { color: #e74c3c; }
.tile-warning .tile-count { color: #f39c12; }
.tile-ok .tile-count { color: #27ae60; }

.machines-list { overflow: hidden; }
.machines-inner {
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    margin-top: -4px;
    padding: 0.5rem 0;
}
.machine-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #333;
    transition: background 0.15s;
}
.machine-row:hover { background: #f8f9fa; }
.machine-hostname { font-weight: 600; font-size: 0.9rem; }
.machine-value { color: #999; font-size: 0.85rem; }

/* ERROR PAGE */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}
.error-page h1 {
    font-size: 4rem;
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .header { padding: 0 1rem; }
    .main-content { padding: 1rem; }
    .side-panel { width: 100%; }
    .side-panel-content { width: 100%; }
    .detail-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .attrs-grid { grid-template-columns: 1fr; }
    .search-form { flex-direction: column; }
}
