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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    color: #000000;
    line-height: 1.6;
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.header-actions {
    display: flex;
    gap: 10px;
    min-width: 100px;
    justify-content: flex-end;
}

.back-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 12px;
    color: #000000;
    min-width: 100px;
    text-align: left;
}

.back-btn:hover {
    background: #f5f5f5;
    border-radius: 6px;
}

/* Login Page */
.login-box {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    text-align: center;
}

.login-box h1 {
    font-size: 32px;
    margin-bottom: 40px;
    font-weight: 600;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-box input {
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
}

.login-box input:focus {
    border-color: #000000;
}

.login-box button {
    padding: 14px;
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 500;
}

.login-box button:hover {
    background: #333333;
}

.hint {
    margin-top: 20px;
    color: #666666;
    font-size: 14px;
}

.link-text {
    margin-top: 20px;
    color: #666666;
    font-size: 14px;
}

.link-text a {
    color: #000000;
    text-decoration: none;
    font-weight: 500;
}

.link-text a:hover {
    text-decoration: underline;
}

.login-box select {
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    background: #ffffff;
}

.login-box select:focus {
    border-color: #000000;
}

/* Items List */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 0;
}

.item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.item:hover {
    background: #f5f5f5;
    border-color: #000000;
}

.item-name {
    font-size: 16px;
    font-weight: 500;
    flex: 1;
}

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

.delete-item-btn {
    background: none;
    border: 1px solid #e0e0e0;
    color: #000000;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.delete-item-btn:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

/* Buttons */
.add-btn {
    width: 40px;
    height: 40px;
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn:hover {
    background: #333333;
}

.logout-btn {
    padding: 8px 16px;
    background: none;
    color: #000000;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.logout-btn:hover {
    background: #f5f5f5;
}

/* 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: #ffffff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 600;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-content input {
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
}

.modal-content input:focus {
    border-color: #000000;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    background: #ffffff;
}

.modal-actions button[type="submit"],
.modal-actions button:not([type="button"]) {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.modal-actions button:hover {
    opacity: 0.8;
}

.delete-btn {
    background: #ff3b30 !important;
    color: #ffffff !important;
    border-color: #ff3b30 !important;
}

.delete-btn:hover {
    background: #cc2e26 !important;
}

/* Note Link */
.note-link {
    color: #000000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-link:hover {
    text-decoration: underline;
}

.note-icon {
    font-size: 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666666;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666666;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }
    
    .container {
        padding: 15px;
    }
    
    .item {
        padding: 14px 16px;
    }
    
    .modal-content {
        padding: 20px;
    }
}
