* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #000;
}

.container {
    max-width: 500px;
    margin: 20px auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

h1 {
    background: white;
    color: #000;
    text-align: center;
    padding: 20px;
    font-size: 1.4rem;
    margin: 0;
    border-bottom: 2px solid #007bff;
}

#connectContainer {
    text-align: center;
    padding: 15px;
}

#connectBtn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
}

.device-info {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #333;
}

.device-info p {
    margin: 4px 0;
}

.status {
    text-align: center;
    margin: 10px 0;
    color: #d00;
    font-weight: bold;
}

.tabs {
    display: flex;
    background: #f0f0f0;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-weight: bold;
    color: #555;
    cursor: pointer;
}

.tab-btn.active {
    background: white;
    color: #007bff;
    border-bottom: 3px solid #007bff;
}

.tab-content {
    padding: 20px;
}

h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #000;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

#statsTable, #logbookTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

#statsTable td, #logbookTable th, #logbookTable td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

#statsTable td:first-child, #logbookTable th {
    font-weight: bold;
    width: 60%;
}

#logbookTable th {
    background: #007bff;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.field {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
    align-items: center;
}

.field label {
    font-weight: bold;
    min-width: 100px;
}

.field input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: monospace;
    letter-spacing: 1px;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ccc;
    border-radius: 5px;
    background: #f9f9f9;
    margin: 15px 0;
}

.chart-container {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    margin: 15px 0;
    min-height: 220px;
}

#profileChart {
    max-width: 100%;
    height: 200px;
}

.profile-list {
    list-style: none;
    margin: 15px 0;
}

.profile-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 8px;
}

.profile-list li button {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}

.profile-list li button:disabled {
    background: #6c757d;
}

.profile-list li.active {
    background: #d4edda;
    border-color: #28a745;
    font-weight: bold;
}

.btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.btn:disabled {
    background: #ccc;
}

.btn-styled {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    flex: 1;
    min-width: 120px;
}

.software-log {
    margin: 20px;
    border-top: 2px solid #eee;
    padding-top: 15px;
}

.software-log h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #555;
}

.software-log pre {
    background: #000;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    padding: 10px;
    height: 200px;
    overflow-y: auto;
    border-radius: 5px;
    white-space: pre-wrap;
}

#disconnectBtn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 10px;
}

#deviceTimeDisplay {
    font-family: monospace;
    font-weight: bold;
    color: #000;
}

#customTimeInput {
    font-family: monospace;
    letter-spacing: 1px;
}

#securityLockBtn.locked   { background: #dc3545; }
#securityLockBtn.unlocked { background: #28a745; }