

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

:root {
    --bg: #ffffff;
    --card-bg: #f8f9fa;
    --text: #212529;
    --border: #dee2e6;
    --primary: #0d6efd;
    --danger: #dc3545;
    --success: #198754;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Login */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-form {
    width: 100%;
    max-width: 320px;
}

.login-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
}

.login-form button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

.error {
    color: var(--danger);
    margin-top: 12px;
    text-align: center;
}

/* Header */
header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 20px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

/* Main */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #6c757d;
}

/* Form */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
}

input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
    background: white;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Postings */
#postings {
    margin-bottom: 16px;
}

.posting {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr auto;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.posting input {
    padding: 8px;
}

.remove-posting {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}

#addPosting {
    width: 100%;
    padding: 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 16px;
}

.form-actions {
    display: flex;
    gap: 8px;
}

.form-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 500;
}

#submitBtn {
    background: var(--success);
    color: white;
}

#cancelEdit {
    background: #6c757d;
    color: white;
}

/* Register */
#registerContent {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.transaction {
    margin-bottom: 16px;
    padding: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.transaction:hover {
    background: #f0f0f0;
}

.transaction-date {
    color: var(--primary);
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.info-text {
    padding: 12px;
    background: var(--card-bg);
    border-radius: 6px;
    margin-bottom: 16px;
    font-family: monospace;
}

#closeSettings {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .posting {
        grid-template-columns: 1fr;
    }
    
    .remove-posting {
        width: 100%;
    }
    
    main {
        padding: 12px;
    }
    
    .card {
        padding: 16px;
    }
}