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

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

.navbar {
    background: #1a1f26;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2f3336;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1d9bf0;
}

.nav-links a {
    color: #e7e9ea;
    text-decoration: none;
    margin-left: 1.5rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #1d9bf0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: #1a1f26;
    padding: 3rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #2f3336;
}

.login-box h1 {
    margin-bottom: 2rem;
    text-align: center;
    color: #1d9bf0;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #8b98a5;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #2f3336;
    border-radius: 6px;
    background: #0f1419;
    color: #e7e9ea;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #1d9bf0;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #1a8cd8;
}

.btn-success {
    background: #00ba7c;
    color: white;
}

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

.btn-warning {
    background: #ffd400;
    color: #0f1419;
}

.btn-info {
    background: #794bc4;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(244, 33, 46, 0.1);
    border: 1px solid #f4212e;
    color: #f4212e;
}

.alert-success {
    background: rgba(0, 186, 124, 0.1);
    border: 1px solid #00ba7c;
    color: #00ba7c;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    margin-bottom: 1rem;
}

.stats-summary {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-card {
    background: #1a1f26;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #2f3336;
    text-align: center;
    min-width: 120px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #1d9bf0;
}

.stat-label {
    color: #8b98a5;
    font-size: 0.875rem;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 2rem;
}

.machine-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1f26;
    border-radius: 8px;
    overflow: hidden;
}

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

.machine-table th {
    background: #15181c;
    color: #8b98a5;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.machine-table tbody tr:hover {
    background: rgba(29, 155, 240, 0.05);
}

.machine-table a {
    color: #1d9bf0;
    text-decoration: none;
}

.machine-table a:hover {
    text-decoration: underline;
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-online {
    background: #00ba7c;
    box-shadow: 0 0 8px rgba(0, 186, 124, 0.5);
}

.status-offline {
    background: #71767b;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(0, 186, 124, 0.2);
    color: #00ba7c;
}

.badge-danger {
    background: rgba(244, 33, 46, 0.2);
    color: #f4212e;
}

.badge-pending {
    background: rgba(255, 212, 0, 0.2);
    color: #ffd400;
}

.badge-sent {
    background: rgba(29, 155, 240, 0.2);
    color: #1d9bf0;
}

.badge-completed {
    background: rgba(0, 186, 124, 0.2);
    color: #00ba7c;
}

.no-data {
    text-align: center;
    color: #71767b;
    padding: 2rem;
}

.info-box {
    background: #1a1f26;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #2f3336;
    margin-top: 2rem;
}

.info-box h3 {
    margin-bottom: 1rem;
    color: #1d9bf0;
}

.info-box code {
    background: #0f1419;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.machine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.machine-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-badge.status-online {
    background: rgba(0, 186, 124, 0.2);
    color: #00ba7c;
}

.status-badge.status-offline {
    background: rgba(113, 118, 123, 0.2);
    color: #71767b;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-card {
    background: #1a1f26;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #2f3336;
}

.detail-card h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #2f3336;
    font-size: 1.1rem;
}

.detail-card dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
}

.detail-card dt {
    color: #8b98a5;
}

.detail-card dd {
    font-weight: 500;
}

.detail-card code {
    background: #0f1419;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    word-break: break-all;
}

.stat-highlight {
    font-size: 1.5rem;
    color: #1d9bf0;
}

.rename-form {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.rename-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #2f3336;
    border-radius: 6px;
    background: #0f1419;
    color: #e7e9ea;
}

.commands-section {
    background: #1a1f26;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #2f3336;
    margin-bottom: 2rem;
}

.commands-section h2 {
    margin-bottom: 1rem;
}

.command-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.inline-form {
    display: inline;
}

.software-update-form {
    border-top: 1px solid #2f3336;
    padding-top: 1.5rem;
    margin-top: 1rem;
}

.software-update-form h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.commands-history {
    background: #1a1f26;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #2f3336;
}

.commands-history h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #2f3336;
}

.command-list {
    list-style: none;
    margin-bottom: 2rem;
}

.command-list li {
    padding: 0.75rem;
    background: #15181c;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.command-list .payload {
    color: #8b98a5;
    font-size: 0.875rem;
}

.command-list .timestamp {
    margin-left: auto;
    color: #71767b;
    font-size: 0.75rem;
}

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

.command-table th,
.command-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #2f3336;
}

.command-table th {
    color: #8b98a5;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    color: #e7e9ea;
}

.analytics-controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: #1a1f26;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #2f3336;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    color: #8b98a5;
    font-size: 0.875rem;
}

.control-group select {
    padding: 0.5rem 1rem;
    border: 1px solid #2f3336;
    border-radius: 6px;
    background: #0f1419;
    color: #e7e9ea;
    font-size: 1rem;
    min-width: 200px;
}

.control-group select:focus {
    outline: none;
    border-color: #1d9bf0;
}

.stats-cards {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: #1a1f26;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #2f3336;
    margin-bottom: 2rem;
}

.table-container h3 {
    margin-bottom: 1rem;
    color: #e7e9ea;
}

.proxy-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.test-progress {
    color: #8b98a5;
    font-size: 0.9rem;
}

.error-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f4212e;
    font-size: 0.85rem;
}
