* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #202124;
}

header {
    background: #ffffff;
    border-bottom: 1px solid #d9dde3;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 {
    margin: 0 0 4px 0;
    font-size: 22px;
}

main {
    padding: 24px;
}

button {
    cursor: pointer;
    padding: 9px 14px;
}

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

.login-box {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    padding: 28px;
    border: 1px solid #d9dde3;
    border-radius: 8px;
}

.login-box h1 {
    margin-top: 0;
}

.login-box label {
    display: block;
    margin-top: 16px;
    margin-bottom: 6px;
}

.login-box input {
    width: 100%;
    padding: 10px;
}

.login-box button {
    width: 100%;
    margin-top: 20px;
}

.error {
    padding: 10px;
    border: 1px solid #c62828;
    background: #ffebee;
    color: #b71c1c;
    margin: 16px 0;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions form {
    margin: 0;
}

.search-panel {
    margin-bottom: 12px;
}

.search-panel.hidden {
    display: none;
}

.search-panel input {
    width: 100%;
    max-width: 420px;
    padding: 9px 12px;
    border: 1px solid #c8cdd3;
    border-radius: 5px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border: 1px solid #d9dde3;
    border-radius: 6px;
}

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

th,
td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7ea;
    white-space: nowrap;
}

th {
    background: #f5f6f7;
    font-size: 13px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #f8fafc;
}

.mono {
    font-family: Consolas, "Liberation Mono", monospace;
}

.muted {
    color: #8a9099;
}

.password-set {
    letter-spacing: 2px;
}

.edit-button {
    padding: 5px 10px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.close-button {
    border: 0;
    background: transparent;
    font-size: 24px;
    padding: 2px 8px;
}

.device-id {
    margin-bottom: 16px;
    color: #555;
}

.modal-content label {
    display: block;
    margin-top: 12px;
    margin-bottom: 5px;
    font-weight: 600;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #c8cdd3;
    border-radius: 5px;
    font-family: inherit;
}

.modal-content textarea {
    resize: vertical;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

button.primary {
    background: #2563eb;
    color: white;
    border: 1px solid #2563eb;
    border-radius: 4px;
}

.password-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.password-value {
    display: inline-block;
    min-width: 80px;
    font-family: Consolas, "Liberation Mono", monospace;
}

.password-cell button {
    padding: 5px 8px;
}

.password-copy-button.hidden {
    display: none;
}

.password-input-row {
    display: flex;
    gap: 8px;
}

.password-input-row input {
    flex: 1;
}

.password-input-row button {
    flex: 0 0 auto;
}

.field-hint {
    margin-top: 5px;
    color: #737982;
    font-size: 12px;
}